Compare commits
3 commits
7f9ce27191
...
61a0c34822
| Author | SHA1 | Date | |
|---|---|---|---|
| 61a0c34822 | |||
| d022336dff | |||
| 4fdfdc3fdb |
5 changed files with 15 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@
|
||||||
.godot/
|
.godot/
|
||||||
/android/
|
/android/
|
||||||
addons/godot-git-plugin
|
addons/godot-git-plugin
|
||||||
|
addons/script-ide
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ func _ready() -> void:
|
||||||
assert(level != null, "The LevelCamera type must be used only in the level scene. It needs the owner to be a Level node.")
|
assert(level != null, "The LevelCamera type must be used only in the level scene. It needs the owner to be a Level node.")
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func follow_gameplay(delta: float) -> void:
|
||||||
var total_weight: float = ball_weight + player_weight * 2.0
|
var total_weight: float = ball_weight + player_weight * 2.0
|
||||||
target_pos = (
|
target_pos = (
|
||||||
level.ball.global_position * ball_weight +
|
level.ball.global_position * ball_weight +
|
||||||
|
|
|
||||||
11
scenes/level_director/level_director.gd
Normal file
11
scenes/level_director/level_director.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends StateMachine
|
||||||
|
|
||||||
|
# TODO: remove this file (its for debug only)
|
||||||
|
func _ready() -> void:
|
||||||
|
assert(state != null, "initial state is null")
|
||||||
|
for state_node: State in find_children("*", "State"):
|
||||||
|
# fixes duplicate connections (not sure why)
|
||||||
|
if not state_node.finished.is_connected(_transition_to_next_state):
|
||||||
|
state_node.finished.connect(_transition_to_next_state)
|
||||||
|
await owner.ready
|
||||||
|
state.enter("", {"round": 0, "restart": false})
|
||||||
1
scenes/level_director/level_director.gd.uid
Normal file
1
scenes/level_director/level_director.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bio2cjqps6kg1
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://4eo7g5abxolw"]
|
[gd_scene load_steps=2 format=3 uid="uid://4eo7g5abxolw"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dqjaxgmyxq3rx" path="res://classes/state_machine/state_machine.gd" id="1_4q8ux"]
|
[ext_resource type="Script" uid="uid://bio2cjqps6kg1" path="res://scenes/level_director/level_director.gd" id="1_4q8ux"]
|
||||||
|
|
||||||
[node name="LevelDirector" type="Node"]
|
[node name="LevelDirector" type="Node"]
|
||||||
script = ExtResource("1_4q8ux")
|
script = ExtResource("1_4q8ux")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue