summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/CameraTrackFollower.gd9
-rw-r--r--components/Level.gd2
-rw-r--r--scenes/levels/base_level.gd2
3 files changed, 6 insertions, 7 deletions
diff --git a/components/CameraTrackFollower.gd b/components/CameraTrackFollower.gd
index e2d9bbe..ede4484 100644
--- a/components/CameraTrackFollower.gd
+++ b/components/CameraTrackFollower.gd
@@ -1,12 +1,13 @@
extends Camera2D
class_name CameraTrackFollower
-var path : Path2D setget _path
+var path : Path2D setget set_path
signal done()
var _points
-func _path(value):
+func set_path(value):
path = value
+ current_speed = 0
if path == null:
_points = []
_pidx = -1
@@ -14,8 +15,6 @@ func _path(value):
_pidx = 0
_t = 0
_points = value.curve.get_baked_points()
- current_speed = 0
- _done_emitted = false
print("New path set to CameraTrackFollower")
export var speedup = 100
export var speedup_time = 5
@@ -31,6 +30,8 @@ func _process(delta):
emit_signal("done")
_done_emitted = true
return
+ else:
+ _done_emitted = false
var next_point = _points[_pidx]
var dist : Vector2 = next_point - position
if _t < speedup_time:
diff --git a/components/Level.gd b/components/Level.gd
index c3cb338..94f918a 100644
--- a/components/Level.gd
+++ b/components/Level.gd
@@ -6,7 +6,7 @@ signal level_finished()
func start():
- print("Level starting.")
+ print("Level ", name, " starting.")
func lose_heart():
emit_signal("lost_heart")
diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd
index dc344e2..b53acf8 100644
--- a/scenes/levels/base_level.gd
+++ b/scenes/levels/base_level.gd
@@ -57,8 +57,6 @@ func _load_next_level():
_load_current_level()
func _unload_current_level():
- _path_renderer.path = null
- _camera.path = null
_loaded_level = null
for c in _level_holder.get_children():
_delayed_delete(c)