summaryrefslogtreecommitdiff
path: root/scenes/levels
diff options
context:
space:
mode:
authorrom <romangraef@gmail.com>2021-04-26 21:45:31 +0200
committerrom <romangraef@gmail.com>2021-04-26 21:45:31 +0200
commit16bf959cd60a79fe906ad7e64574e4a77bd80517 (patch)
tree59b20568016840cbbd8fe2d5811d4563ad8835f5 /scenes/levels
parentd44dfdce553254fed44c58a25fd4d5235fdc1326 (diff)
downloadldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.tar.gz
ldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.tar.bz2
ldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.zip
peaceful
Diffstat (limited to 'scenes/levels')
-rw-r--r--scenes/levels/base_level.gd5
-rw-r--r--scenes/levels/base_level.tscn1
-rw-r--r--scenes/levels/puzzle/puzzle.gd1
-rw-r--r--scenes/levels/reactiontest.gd12
4 files changed, 14 insertions, 5 deletions
diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd
index e7db980..4c1ef70 100644
--- a/scenes/levels/base_level.gd
+++ b/scenes/levels/base_level.gd
@@ -55,9 +55,12 @@ func _on_Level_lost_heart(instakill):
if instakill:
_health = 0
_health -= 1
+ _health = 10
+ _health_bar.set_health(_health)
+ if instakill:
+ _load_next_level()
if _health <= 0:
get_tree().change_scene("res://scenes/game_over.tscn")
- _health_bar.set_health(_health)
func _load_next_level():
_unload_current_level()
diff --git a/scenes/levels/base_level.tscn b/scenes/levels/base_level.tscn
index 6681a7d..e2d57ba 100644
--- a/scenes/levels/base_level.tscn
+++ b/scenes/levels/base_level.tscn
@@ -41,6 +41,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"]
diff --git a/scenes/levels/puzzle/puzzle.gd b/scenes/levels/puzzle/puzzle.gd
index ffebcab..c23b3a2 100644
--- a/scenes/levels/puzzle/puzzle.gd
+++ b/scenes/levels/puzzle/puzzle.gd
@@ -69,7 +69,6 @@ func _do_push(from, to):
if not (same_row or same_col):
print("Invalid move")
return
- print("Performing push from ", from, " to ", to, " in direction ", dir)
var i = to
while i != from:
var next_pos
diff --git a/scenes/levels/reactiontest.gd b/scenes/levels/reactiontest.gd
index ba6d97b..d9db685 100644
--- a/scenes/levels/reactiontest.gd
+++ b/scenes/levels/reactiontest.gd
@@ -8,14 +8,19 @@ var timer = 0
func _total_time():
if Settings.difficulty == Settings.Difficulty.HARD:
- return 4
- return 6
+ return 6
+ if Settings.difficulty == Settings.Difficulty.PEACEFUL:
+ return 60
+ return 10
func start():
.start()
+var started = false
+
func _ready():
timer = 0
+ started = false
for i in range(buttons.size()):
buttons[i].connect("on_click", self, "_on_Any_button_click", [i])
buttons[i].text = str(i + 1)
@@ -23,13 +28,14 @@ func _ready():
buttons[i].visible = false
func _process(delta):
- if running:
+ if running and started:
timer += delta
timer_label.text = str(_total_time() - timer)
if timer >= _total_time():
lose_all_hearts()
func _on_Any_button_click(btn_idx):
+ started = true
if btn_idx == sequence_index:
sequence_index += 1
if sequence_index == buttons.size():