From 85da9f59bad9ae98e61820f9feaff0dd5968228f Mon Sep 17 00:00:00 2001 From: rom Date: Mon, 26 Apr 2021 21:22:40 +0200 Subject: loop --- scenes/levels/base_level.gd | 10 +++++++--- scenes/levels/base_level.tscn | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd index 3c52029..e7db980 100644 --- a/scenes/levels/base_level.gd +++ b/scenes/levels/base_level.gd @@ -28,14 +28,18 @@ func _ready(): func _get_next_level_pos() -> Vector2: var dir = (randi() % 2) * 2 -1 - return _last_camera_location + Vector2(1000, dir * (1000 + randi() % 1000)) + return _last_camera_location + Vector2(1000, dir * (1024 + randi() % 1024)) func _create_path_from(from: Vector2, to: Vector2): var path = Path2D.new() var curve = Curve2D.new() - var diff = to -from + var diff = to - from + var extra_x = randf() * 400 + 100 + var extra_y = (randf() * 400 + 100) * ((randi() % 2) * 2 - 1) curve.add_point(from) - curve.add_point(from + Vector2(diff.x, 0)) + curve.add_point(from + Vector2(diff.x + extra_x, 0)) + curve.add_point(from + Vector2(diff.x + extra_x, extra_y)) + curve.add_point(from + Vector2(diff.x, extra_y)) curve.add_point(to) path.curve = curve return path diff --git a/scenes/levels/base_level.tscn b/scenes/levels/base_level.tscn index 6681a7d..c13cdaa 100644 --- a/scenes/levels/base_level.tscn +++ b/scenes/levels/base_level.tscn @@ -24,6 +24,7 @@ __meta__ = { position = Vector2( 153.457, 427.259 ) current = true script = ExtResource( 7 ) +speedup_time = 10 [node name="healthbar" parent="Camera2D" instance=ExtResource( 3 )] position = Vector2( -595.377, -321.363 ) @@ -41,6 +42,7 @@ position = Vector2( 571.642, -311.599 ) text = "Menu" [node name="PauseMenu" parent="Camera2D" instance=ExtResource( 5 )] + [connection signal="done" from="Camera2D" to="." method="_on_Camera2D_done"] [connection signal="on_click" from="Camera2D/MenuButton" to="." method="_on_MenuButton_on_click"] [connection signal="unpause" from="Camera2D/PauseMenu" to="." method="_on_PauseMenu_unpause"] -- cgit