summaryrefslogtreecommitdiff
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
parentd44dfdce553254fed44c58a25fd4d5235fdc1326 (diff)
downloadldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.tar.gz
ldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.tar.bz2
ldjam48-16bf959cd60a79fe906ad7e64574e4a77bd80517.zip
peaceful
-rw-r--r--components/Settings.gd2
-rw-r--r--scenes/introduction/check_mail.gd2
-rw-r--r--scenes/introduction/check_mail.tscn1
-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
-rw-r--r--scenes/menu.gd9
-rw-r--r--scenes/menu.tscn3
9 files changed, 26 insertions, 10 deletions
diff --git a/components/Settings.gd b/components/Settings.gd
index a3cdd6b..c652b16 100644
--- a/components/Settings.gd
+++ b/components/Settings.gd
@@ -1,6 +1,6 @@
extends Node
-enum Difficulty {EASY, HARD}
+enum Difficulty {PEACEFUL, EASY, HARD}
var sound_level : int = 100
var difficulty = Difficulty.EASY
diff --git a/scenes/introduction/check_mail.gd b/scenes/introduction/check_mail.gd
index 6d03cce..1ff4172 100644
--- a/scenes/introduction/check_mail.gd
+++ b/scenes/introduction/check_mail.gd
@@ -12,7 +12,7 @@ func login():
get_tree().change_scene("res://scenes/introduction/mail.tscn")
func check_pw():
- if passwordfield.text == correct:
+ if passwordfield.text == correct or Settings.difficulty == Settings.Difficulty.PEACEFUL:
login()
else:
if passwordfield.text == "deeper" or trys == 5:
diff --git a/scenes/introduction/check_mail.tscn b/scenes/introduction/check_mail.tscn
index 6f6c1e2..ee9f29c 100644
--- a/scenes/introduction/check_mail.tscn
+++ b/scenes/introduction/check_mail.tscn
@@ -107,6 +107,7 @@ text = "Too many trys. Password was reset to \"tom\""
__meta__ = {
"_edit_use_anchors_": false
}
+
[connection signal="text_changed" from="password" to="." method="_on_password_text_changed"]
[connection signal="text_entered" from="password" to="." method="_on_password_text_entered"]
[connection signal="on_click" from="Log in" to="." method="_on_Log_in_on_click"]
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():
diff --git a/scenes/menu.gd b/scenes/menu.gd
index 3053744..6ed7929 100644
--- a/scenes/menu.gd
+++ b/scenes/menu.gd
@@ -27,11 +27,18 @@ func _on_Back_on_click():
func _difficulty_text():
if Settings.difficulty == Settings.Difficulty.HARD:
$Content/CustomLabel.text = "Hard"
+ elif Settings.difficulty == Settings.Difficulty.PEACEFUL:
+ $Content/CustomLabel.text = "Peaceful"
else:
$Content/CustomLabel.text = "Easy"
func _on_HardMode_on_click():
- Settings.difficulty = 1 - Settings.difficulty
+ if Settings.difficulty == Settings.Difficulty.EASY:
+ Settings.difficulty = Settings.Difficulty.HARD
+ elif Settings.difficulty == Settings.Difficulty.HARD:
+ Settings.difficulty = Settings.Difficulty.PEACEFUL
+ else:
+ Settings.difficulty = Settings.Difficulty.EASY
_difficulty_text()
Settings.save()
diff --git a/scenes/menu.tscn b/scenes/menu.tscn
index ad2f2d4..bb645a7 100644
--- a/scenes/menu.tscn
+++ b/scenes/menu.tscn
@@ -140,12 +140,10 @@ __meta__ = {
[node name="HardMode" parent="Content" instance=ExtResource( 2 )]
position = Vector2( 748.159, 998.785 )
-text = ""
fixed_width = 150
[node name="Fullscreen" parent="Content" instance=ExtResource( 2 )]
position = Vector2( 747.136, 1121.03 )
-text = ""
fixed_width = 150
[node name="FullscreenLabel" type="Label" parent="Content"]
@@ -224,6 +222,7 @@ anims/tosettings = SubResource( 4 )
[node name="success_sound" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
+
[connection signal="on_click" from="Content/Back" to="." method="_on_Back_on_click"]
[connection signal="on_click" from="Content/HardMode" to="." method="_on_HardMode_on_click"]
[connection signal="on_click" from="Content/Fullscreen" to="." method="_on_Fullscreen_on_click"]