From d22290e239793a7fac7137a29aa4701c91c06252 Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Mon, 12 Jun 2023 22:43:11 +0200 Subject: [PATCH] fix: die on timer despite shield, ingame control menu upause fixed --- src/Actors/Blobby/Blobby.gd | 8 ++++++++ src/Actors/Blobby/Blobby.tscn | 4 ++-- src/Actors/Blobby/BlobbyStateMachine.gd | 2 +- src/UserInterface/Screens/InGameMenu/PauseScreen.gd | 2 +- src/UserInterface/Screens/InGameMenu/PauseScreen.tscn | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Actors/Blobby/Blobby.gd b/src/Actors/Blobby/Blobby.gd index dc7e202..1194d04 100644 --- a/src/Actors/Blobby/Blobby.gd +++ b/src/Actors/Blobby/Blobby.gd @@ -414,6 +414,7 @@ func calculate_slope_rotation(onfloor: bool) -> float: func stomp() -> void: stomping = true +# TOD lose_power_up function func receive_power_up(kind: String) -> void: if kind == "shield": $BubbleShieldViewport/IridescenceBall.visible = true @@ -437,6 +438,12 @@ func die(animation_number: int = 0) -> void: if animation_number < 1: $BlobbySprite/BlobbymationPlayer.play("expandingDisolve") +func die_for_real(animation_number: int = 0) -> void: + shielded = false + $BubbleShieldViewport/IridescenceBall.visible = false + die(animation_number) + + # TODO Checkpoint system func respawn() -> void: # Is tied to the death animation @@ -481,6 +488,7 @@ func _on_InvincibilityTimer_timeout() -> void: die() func _on_PitfallTimer_timeout() -> void: + # TODO Debuff function to remove wanted buffs shielded = false levelState.player_dying() respawn() diff --git a/src/Actors/Blobby/Blobby.tscn b/src/Actors/Blobby/Blobby.tscn index aacba9d..446274c 100644 --- a/src/Actors/Blobby/Blobby.tscn +++ b/src/Actors/Blobby/Blobby.tscn @@ -3283,7 +3283,7 @@ tracks/6/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, -"values": [ Vector2( 1.0, -8.97473 ) ] +"values": [ Vector2( 1, -8.97473 ) ] } tracks/7/type = "value" tracks/7/path = NodePath("../BlobbySkin/CollisionPolygon2D:shape:extents") @@ -3307,7 +3307,7 @@ tracks/8/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, -"values": [ Vector2( 1.0, -8.97473 ) ] +"values": [ Vector2( 1, -8.97473 ) ] } tracks/9/type = "value" tracks/9/path = NodePath(".:offset") diff --git a/src/Actors/Blobby/BlobbyStateMachine.gd b/src/Actors/Blobby/BlobbyStateMachine.gd index 732d421..aef421d 100644 --- a/src/Actors/Blobby/BlobbyStateMachine.gd +++ b/src/Actors/Blobby/BlobbyStateMachine.gd @@ -21,7 +21,7 @@ var was_coyote_hanging = false # Adds the intial states func _ready(): - signalManager.connect("getback_timer_up", parent, "die", [1]) + signalManager.connect("getback_timer_up", parent, "die_for_real", [1]) signalManager.connect("power_up_collected", parent, "receive_power_up") signalManager.connect("got_stomped", parent, "stomp") anim_player.play("RESET") diff --git a/src/UserInterface/Screens/InGameMenu/PauseScreen.gd b/src/UserInterface/Screens/InGameMenu/PauseScreen.gd index ed6ad4e..e6ec352 100644 --- a/src/UserInterface/Screens/InGameMenu/PauseScreen.gd +++ b/src/UserInterface/Screens/InGameMenu/PauseScreen.gd @@ -19,7 +19,7 @@ func _on_GlobalState_player_died() -> void: func _unhandled_input(event: InputEvent) -> void: - if event.is_action_pressed("pause") and pause_title.text != "You lost": + if event.is_action_pressed("pause") && pause_title.text != "You lost" && !$ControlsMenu.visible: #not oder ! schaltet einen boolean um #Ist self hier notwendig? self.paused = not paused diff --git a/src/UserInterface/Screens/InGameMenu/PauseScreen.tscn b/src/UserInterface/Screens/InGameMenu/PauseScreen.tscn index df71f8e..f5ab3fb 100644 --- a/src/UserInterface/Screens/InGameMenu/PauseScreen.tscn +++ b/src/UserInterface/Screens/InGameMenu/PauseScreen.tscn @@ -455,7 +455,7 @@ text = "Controls" margin_top = 127.0 margin_right = 222.0 margin_bottom = 186.0 -focus_neighbour_top = NodePath("../Continue") +focus_neighbour_top = NodePath("../Controls") focus_neighbour_bottom = NodePath("../MainMenuButton") [node name="MainMenuButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 3 )]