From 100c9b547adaef83308dba012dc488fdceaf0563 Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Sun, 30 Jul 2023 17:47:32 +0200 Subject: [PATCH] fix: Solution for getting stuck under frog --- src/Actors/Enemies/Beings/WhatAreFrog.gd | 89 ++++++++++--------- src/Actors/Enemies/Beings/WhatAreFrog.tscn | 14 ++- src/Levels/1 Tutorial Level.tscn | 4 +- src/Levels/2 Tutorial Level.tscn | 13 ++- src/Levels/3 Tutorial Level.tscn | 6 +- .../Screens/InGameMenu/PauseScreen.gd | 16 +++- .../MainMenu/ControlsMenu/ControlsMenu.gd | 2 + 7 files changed, 89 insertions(+), 55 deletions(-) diff --git a/src/Actors/Enemies/Beings/WhatAreFrog.gd b/src/Actors/Enemies/Beings/WhatAreFrog.gd index 7b34094..cebc3be 100644 --- a/src/Actors/Enemies/Beings/WhatAreFrog.gd +++ b/src/Actors/Enemies/Beings/WhatAreFrog.gd @@ -76,6 +76,54 @@ func bind_to_anchor(anchor_node: Node2D, radius: float ) -> void: $LeashAnchor.visible = true + +func execute_movement(delta: float) -> void: + # Navigation2DServer.map_get_path() + current_delta = delta + # TODO what when the game runs really long and the float runs out of space? + # Achievment maybe lul + detect_timer += delta + velocity.y += _gravity * delta + if(is_bound): + var next_position = global_position + velocity * current_delta + var current_distance = global_position.distance_to(anchor.global_position) + var new_distance = next_position.distance_to(anchor.global_position) + # TODO Fix this in respects to x and y distances and movement dampening + # Maybe use mathemathematics or something idfc + if(current_distance >= movement_radius && new_distance > current_distance): + velocity.x = velocity.x * 0.8 + velocity.y = velocity.y * 0.8 + was_restricted = true + velocity = move_and_slide(velocity, FLOOR_NORMAL, false, 4, 0.785398, false) + + if($"%GroundDetector".get_overlapping_bodies().size() > 0): + velocity.y -= 10 * (delta/0.0083) + var min_x_slide_velocity = 50 * (delta/0.0083) + velocity.x = sign(velocity.x) * max(min_x_slide_velocity, velocity.x * 0.99) + return + elif(is_on_floor()): + velocity = Vector2(0,0) + + # Reverse direction when hitting limit + + +func die() -> void: + levelState.kills += 1 + queue_free() + + +func _on_EnemySkin_area_entered(area:Area2D) -> void: + if area.is_in_group("harmful"): + get_node("EnemyBody").disabled = true + die() + + +func _on_EnemySkin_body_entered(body: Node) -> void: + if body.is_in_group("frogfood"): + loose_target() + body.die() + + func _on_StompDetector_body_entered(body: Node) -> void: if body.is_in_group("player"): attached_player = body @@ -102,47 +150,6 @@ func _on_StompDetector_body_exited(body: Node) -> void: $FeelerRayCast.collision_mask += 1 attached_player = null -func execute_movement(delta: float) -> void: - # Navigation2DServer.map_get_path() - current_delta = delta - detect_timer += delta - velocity.y += _gravity * delta - if(is_bound): - var next_position = global_position + velocity * current_delta - var current_distance = global_position.distance_to(anchor.global_position) - var new_distance = next_position.distance_to(anchor.global_position) - # TODO Fix this in respects to x and y distances and movement dampening - # Maybe use mathemathematics or something idfc - if(current_distance >= movement_radius && new_distance > current_distance): - velocity.x = velocity.x * 0.8 - velocity.y = velocity.y * 0.8 - was_restricted = true - velocity = move_and_slide(velocity, FLOOR_NORMAL, false, 4, 0.785398, false) - - if(is_on_floor()): - velocity = Vector2(0,0) - - # Reverse direction when hitting limit - - - - -func die() -> void: - levelState.kills += 1 - queue_free() - - -func _on_EnemySkin_area_entered(area:Area2D) -> void: - if area.is_in_group("harmful"): - get_node("EnemyBody").disabled = true - die() - - -func _on_EnemySkin_body_entered(body: Node) -> void: - if body.is_in_group("frogfood"): - loose_target() - body.die() - func searching() -> Vector2: if(detect_timer > 0.333): diff --git a/src/Actors/Enemies/Beings/WhatAreFrog.tscn b/src/Actors/Enemies/Beings/WhatAreFrog.tscn index a1c8826..7d3ad5e 100644 --- a/src/Actors/Enemies/Beings/WhatAreFrog.tscn +++ b/src/Actors/Enemies/Beings/WhatAreFrog.tscn @@ -427,7 +427,7 @@ graph_offset = Vector2( -379, -204 ) extents = Vector2( 12, 9 ) [sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 11, 1.875 ) +extents = Vector2( 12, 0.5 ) [sub_resource type="RectangleShape2D" id=3] extents = Vector2( 18.2143, 13.5955 ) @@ -559,6 +559,18 @@ monitorable = false position = Vector2( 0, -0.875 ) shape = SubResource( 2 ) +[node name="GroundDetector" type="Area2D" parent="."] +unique_name_in_owner = true +modulate = Color( 0, 0.0392157, 1, 1 ) +position = Vector2( 0, 9 ) +collision_layer = 0 +input_pickable = false +monitorable = false + +[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundDetector"] +position = Vector2( 0, 2 ) +shape = SubResource( 2 ) + [node name="EnemySkin" type="Area2D" parent="."] process_priority = -1 scale = Vector2( 0.7, 0.7 ) diff --git a/src/Levels/1 Tutorial Level.tscn b/src/Levels/1 Tutorial Level.tscn index 30c0b40..e4a62d6 100644 --- a/src/Levels/1 Tutorial Level.tscn +++ b/src/Levels/1 Tutorial Level.tscn @@ -42,10 +42,10 @@ unique_name_in_owner = true process_mode = 1 [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 5 +frame = 8 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 4 +frame = 7 [node name="Blobby" parent="." instance=ExtResource( 7 )] unique_name_in_owner = true diff --git a/src/Levels/2 Tutorial Level.tscn b/src/Levels/2 Tutorial Level.tscn index 1ea3e56..03fb708 100644 --- a/src/Levels/2 Tutorial Level.tscn +++ b/src/Levels/2 Tutorial Level.tscn @@ -59,9 +59,14 @@ wait_time = 20.0 [node name="BlobbyCam" parent="." instance=ExtResource( 7 )] unique_name_in_owner = true +drag_margin_top = 0.1 +drag_margin_bottom = 0.1 [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 10 +frame = 1 + +[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] +frame = 0 [node name="Blobby" parent="." instance=ExtResource( 8 )] unique_name_in_owner = true @@ -84,7 +89,7 @@ collision_layer = 8 collision_mask = 8 bake_navigation = true format = 1 -tile_data = PoolIntArray( -1245078, 5, 6, -1179542, 5, 6, -1114006, 5, 6, -1048470, 5, 6, -982934, 5, 6, -917398, 5, 6, -851862, 5, 6, -720912, 5, 524293, -786326, 5, 6, -655376, 5, 524293, -720790, 5, 6, -589840, 5, 524293, -589835, 1610612741, 196609, -589834, 5, 196613, -589833, -1073741819, 196609, -589829, 1610612741, 6, -655254, 5, 6, -524304, 5, 524293, -524299, -1073741819, 196616, -524298, 5, 393221, -524297, -1073741819, 196610, -524293, 1610612741, 6, -589718, 5, 6, -458768, 5, 524293, -458763, -1610612731, 196609, -458762, 5, 196610, -458761, 5, 196609, -458758, -1073741819, 262150, -458757, 1610612741, 6, -524182, 5, 6, -393232, 5, 524293, -393230, 1610612741, 65539, -393229, 1610612741, 3, -393228, 1610612741, 3, -393227, 1610612741, 3, -393226, 1610612741, 3, -393225, 1610612741, 3, -393224, 1610612741, 3, -393223, 1073741829, 2, -393222, 5, 65541, -393221, 1610612741, 6, -458646, 5, 6, -327696, 5, 524293, -327694, 5, 7, -327686, 5, 6, -327685, 5, 8, -393110, 5, 6, -262160, 5, 524293, -262158, 5, 7, -262150, 5, 6, -262149, 5, 8, -327574, 5, 6, -196624, 5, 524293, -196622, 5, 7, -196614, 5, 6, -196613, 5, 8, -262133, 5, 1, -262132, 5, 2, -262131, 5, 2, -262130, 5, 2, -262129, 5, 2, -262128, 5, 2, -262127, 5, 2, -262126, 5, 2, -262125, 5, 2, -262124, 5, 2, -262123, 5, 5, -262082, 5, 1, -262081, 5, 2, -262080, 5, 2, -262079, 5, 2, -262078, 5, 2, -262077, 5, 2, -262076, 5, 2, -262075, 5, 2, -262074, 5, 2, -262073, 5, 2, -262072, 5, 2, -262071, 5, 2, -262070, 5, 2, -262069, 5, 2, -262068, 5, 2, -262067, 5, 2, -262066, 5, 2, -262065, 5, 2, -262064, 5, 2, -262063, 5, 2, -262062, 5, 2, -262061, 5, 2, -262060, 5, 2, -262059, 5, 2, -262058, 5, 2, -262057, 5, 2, -262056, 5, 2, -262055, 5, 2, -262054, 5, 2, -262053, 5, 2, -262052, 5, 2, -262051, 5, 2, -262050, 5, 2, -262049, 5, 2, -262048, 5, 2, -262047, 5, 2, -262046, 5, 2, -262045, 5, 2, -262044, 5, 2, -262043, 5, 2, -262042, 5, 2, -262041, 5, 2, -262040, 5, 2, -262039, 5, 2, -262038, 5, 65539, -131088, 5, 524293, -131086, 5, 7, -131078, 5, 6, -131077, 5, 65538, -131076, 5, 2, -131075, 5, 2, -131074, 5, 5, -196606, 5, 1, -196605, 5, 2, -196604, 5, 5, -196597, 5, 9, -196596, 5, 10, -196595, 5, 10, -196594, 5, 10, -196593, 5, 65541, -196587, 5, 7, -196546, 5, 6, -65552, 5, 524293, -65550, 5, 7, -65542, 5, 6, -65538, 5, 7, -131070, 5, 6, -131068, 5, 7, -131057, 5, 6, -131051, 5, 7, -131010, 5, 6, -16, 5, 524293, -14, 5, 7, -6, 5, 6, -2, 5, 7, -65534, 5, 6, -65532, 5, 7, -65521, 5, 6, -65515, 5, 7, -65486, 5, 65542, -65485, 5, 65543, -65484, 5, 65543, -65483, 5, 65543, -65482, 5, 65543, -65481, 5, 65543, -65480, 5, 65544, -65474, 5, 6, 65520, 5, 524293, 65522, 5, 7, 65530, 5, 6, 65534, 5, 7, 2, 5, 6, 4, 5, 65538, 5, 5, 2, 6, 5, 2, 7, 5, 5, 15, 5, 6, 21, 5, 7, 29, 5, 1, 30, 5, 2, 31, 5, 2, 32, 5, 2, 33, 5, 2, 34, 5, 2, 35, 5, 2, 36, 5, 2, 37, 5, 2, 38, 5, 2, 39, 5, 2, 40, 5, 2, 41, 5, 2, 42, 5, 2, 43, 5, 5, 62, 5, 6, 131056, 5, 524293, 131058, 5, 7, 131066, 5, 6, 131071, 5, 2, 65536, 5, 2, 65537, 5, 2, 65538, 5, 65540, 65539, 5, 10, 65540, 5, 10, 65541, 5, 10, 65542, 5, 10, 65543, 5, 65536, 65551, 5, 6, 65557, 5, 7, 65565, 5, 6, 65579, 5, 7, 65598, 5, 6, 196592, 5, 524293, 196594, 5, 7, 196602, 5, 9, 196603, 5, 10, 196604, 5, 10, 196605, 5, 10, 196606, 5, 10, 196607, 5, 10, 131072, 5, 10, 131073, 5, 10, 131074, 5, 65536, 131087, 5, 6, 131093, 5, 7, 131101, 5, 6, 131115, 5, 7, 131134, 5, 6, 262128, 5, 524293, 262130, 5, 7, 196619, 5, 1, 196620, 5, 2, 196621, 5, 2, 196622, 5, 2, 196623, 5, 65539, 196629, 5, 7, 196637, 5, 6, 196651, 5, 7, 196670, 5, 6, 327664, 5, 524293, 327666, 5, 7, 262155, 5, 6, 262165, 5, 7, 262173, 5, 6, 262187, 5, 7, 262206, 5, 6, 393200, 5, 524293, 393202, 5, 7, 327691, 5, 6, 327701, 5, 7, 327709, 5, 6, 327723, 5, 7, 327742, 5, 6, 458736, 5, 524293, 458738, 5, 7, 393227, 5, 6, 393237, 5, 7, 393245, 5, 6, 393259, 5, 7, 524272, 5, 524293, 524274, 5, 65538, 524275, 5, 2, 524276, 5, 2, 524277, 5, 2, 524278, 5, 2, 524279, 536870917, 2, 524280, 536870917, 2, 524281, 536870917, 2, 524282, 536870917, 2, 524283, 536870917, 2, 524284, 536870917, 2, 524285, 5, 2, 524286, 5, 2, 524287, 5, 2, 458752, 5, 2, 458753, 5, 2, 458754, 5, 2, 458755, 5, 2, 458756, 5, 2, 458757, 5, 2, 458758, 5, 2, 458759, 5, 2, 458760, 5, 2, 458761, 5, 2, 458762, 5, 2, 458763, 5, 65539, 458795, 5, 7, 589808, 5, 524293, 655344, 5, 524293, 655345, 5, 524293, 655346, 5, 524293, 655347, 5, 524293, 655348, 5, 524293, 655349, 5, 524293, 655350, 5, 524293, 655351, 5, 524293, 655352, 5, 524293, 655353, 5, 524293, 655354, 5, 524293, 655355, 5, 524293, 655356, 5, 524293 ) +tile_data = PoolIntArray( -1245078, 5, 6, -1179542, 5, 6, -1114006, 5, 6, -1048470, 5, 6, -982934, 5, 6, -917398, 5, 6, -851862, 5, 6, -720912, 5, 524293, -786326, 5, 6, -655376, 5, 524293, -720790, 5, 6, -589840, 5, 524293, -589835, 1610612741, 196609, -589834, 5, 196613, -589833, -1073741819, 196609, -589829, 1610612741, 6, -655254, 5, 6, -524304, 5, 524293, -524299, -1073741819, 196616, -524298, 5, 393221, -524297, -1073741819, 196610, -524293, 1610612741, 6, -589718, 5, 6, -458768, 5, 524293, -458763, -1610612731, 196609, -458762, 5, 196610, -458761, 5, 196609, -458758, -1073741819, 262150, -458757, 1610612741, 6, -524182, 5, 6, -393232, 5, 524293, -393230, 1610612741, 65539, -393229, 1610612741, 3, -393228, 1610612741, 3, -393227, 1610612741, 3, -393226, 1610612741, 3, -393225, 1610612741, 3, -393224, 1610612741, 3, -393223, 1073741829, 2, -393222, 5, 65541, -393221, 1610612741, 6, -458646, 5, 6, -327696, 5, 524293, -327694, 5, 7, -327686, 5, 6, -327685, 5, 8, -393110, 5, 6, -262160, 5, 524293, -262158, 5, 7, -262150, 5, 6, -262149, 5, 8, -327574, 5, 6, -196624, 5, 524293, -196622, 5, 7, -196614, 5, 6, -196613, 5, 8, -262133, 5, 1, -262132, 5, 2, -262131, 5, 2, -262130, 5, 2, -262129, 5, 2, -262128, 5, 2, -262127, 5, 2, -262126, 5, 2, -262125, 5, 2, -262124, 5, 2, -262123, 5, 5, -262082, 5, 1, -262081, 5, 2, -262080, 5, 2, -262079, 5, 2, -262078, 5, 2, -262077, 5, 2, -262076, 5, 2, -262075, 5, 2, -262074, 5, 2, -262073, 5, 2, -262072, 5, 2, -262071, 5, 2, -262070, 5, 2, -262069, 5, 2, -262068, 5, 2, -262067, 5, 2, -262066, 5, 2, -262065, 5, 2, -262064, 5, 2, -262063, 5, 2, -262062, 5, 2, -262061, 5, 2, -262060, 5, 2, -262059, 5, 2, -262058, 5, 2, -262057, 5, 2, -262056, 5, 2, -262055, 5, 2, -262054, 5, 2, -262053, 5, 2, -262052, 5, 2, -262051, 5, 2, -262050, 5, 2, -262049, 5, 2, -262048, 5, 2, -262047, 5, 2, -262046, 5, 2, -262045, 5, 2, -262044, 5, 2, -262043, 5, 2, -262042, 5, 2, -262041, 5, 2, -262040, 5, 2, -262039, 5, 2, -262038, 5, 65539, -131088, 5, 524293, -131086, 5, 7, -131078, 5, 6, -131077, 5, 65538, -131076, 5, 2, -131075, 5, 2, -131074, 5, 5, -196606, 5, 1, -196605, 5, 2, -196604, 5, 5, -196597, 5, 9, -196596, 5, 10, -196595, 5, 10, -196594, 5, 10, -196593, 5, 65541, -196587, 5, 7, -196546, 5, 6, -65552, 5, 524293, -65550, 5, 7, -65542, 5, 6, -65538, 5, 7, -131070, 5, 6, -131068, 5, 7, -131057, 5, 6, -131051, 5, 7, -131010, 5, 6, -16, 5, 524293, -14, 5, 7, -6, 5, 6, -2, 5, 7, -65534, 5, 6, -65532, 5, 7, -65521, 5, 6, -65515, 5, 7, -65486, 5, 65542, -65485, 5, 65543, -65484, 5, 65543, -65483, 5, 65543, -65482, 5, 65543, -65481, 5, 65543, -65480, 5, 65544, -65474, 5, 6, 65520, 5, 524293, 65522, 5, 7, 65530, 5, 6, 65534, 5, 7, 2, 5, 6, 4, 5, 65538, 5, 5, 2, 6, 5, 2, 7, 5, 5, 15, 5, 6, 21, 5, 7, 29, 5, 1, 30, 5, 2, 31, 5, 2, 32, 5, 2, 33, 5, 2, 34, 5, 2, 35, 5, 2, 36, 5, 2, 37, 5, 2, 38, 5, 2, 39, 5, 2, 40, 5, 2, 41, 5, 2, 42, 5, 2, 43, 5, 5, 62, 5, 6, 131056, 5, 524293, 131058, 5, 7, 131066, 5, 6, 131071, 5, 2, 65536, 5, 2, 65537, 5, 2, 65538, 5, 65540, 65539, 5, 10, 65540, 5, 10, 65541, 5, 10, 65542, 5, 10, 65543, 5, 65536, 65551, 5, 6, 65557, 5, 7, 65565, 5, 6, 65579, 5, 7, 65598, 5, 6, 196592, 5, 524293, 196594, 5, 7, 196602, 5, 9, 196603, 5, 10, 196604, 5, 10, 196605, 5, 10, 196606, 5, 10, 196607, 5, 10, 131072, 5, 10, 131073, 5, 10, 131074, 5, 65536, 131087, 5, 6, 131093, 5, 7, 131101, 5, 6, 131115, 5, 7, 131134, 5, 6, 262128, 5, 524293, 262130, 5, 7, 196619, 5, 1, 196620, 5, 2, 196621, 5, 2, 196622, 5, 2, 196623, 5, 65539, 196629, 5, 7, 196637, 5, 6, 196651, 5, 7, 196670, 5, 6, 327664, 5, 524293, 327666, 5, 7, 262155, 5, 9, 262156, 5, 10, 262157, 5, 10, 262158, 5, 10, 262159, 5, 10, 262160, 5, 10, 262161, 5, 10, 262162, 5, 10, 262163, 5, 10, 262164, 5, 10, 262165, 5, 65536, 262173, 5, 6, 262187, 5, 7, 262206, 5, 6, 393200, 5, 524293, 393202, 5, 7, 327709, 5, 6, 327723, 5, 7, 327742, 5, 6, 458736, 5, 524293, 458738, 5, 7, 393245, 5, 6, 393259, 5, 7, 393278, 5, 6, 524272, 5, 524293, 524274, 5, 65538, 524275, 5, 2, 524276, 5, 2, 524277, 5, 2, 524278, 5, 2, 524279, 536870917, 2, 524280, 536870917, 2, 524281, 536870917, 2, 524282, 536870917, 2, 524283, 536870917, 2, 524284, 536870917, 2, 524285, 5, 2, 524286, 5, 2, 524287, 5, 2, 458752, 5, 2, 458753, 5, 2, 458754, 5, 2, 458755, 5, 2, 458756, 5, 2, 458757, 5, 2, 458758, 5, 2, 458759, 5, 2, 458760, 5, 2, 458761, 5, 2, 458762, 5, 2, 458763, 5, 3, 458764, 5, 3, 458765, 5, 3, 458766, 5, 3, 458767, 5, 3, 458768, 5, 3, 458769, 5, 3, 458770, 5, 3, 458771, 5, 3, 458772, 5, 3, 458773, 5, 3, 458774, 5, 3, 458775, 5, 3, 458776, 5, 3, 458777, 5, 3, 458778, 5, 3, 458779, 5, 3, 458780, 5, 3, 458781, 5, 65539, 458795, 5, 7, 458814, 5, 6, 589808, 5, 524293, 655344, 5, 524293, 655345, 5, 524293, 655346, 5, 524293, 655347, 5, 524293, 655348, 5, 524293, 655349, 5, 524293, 655350, 5, 524293, 655351, 5, 524293, 655352, 5, 524293, 655353, 5, 524293, 655354, 5, 524293, 655355, 5, 524293, 655356, 5, 524293 ) [node name="DropThroughPlatforms" type="TileMap" parent="."] tile_set = ExtResource( 4 ) @@ -97,7 +102,7 @@ cell_size = Vector2( 16, 16 ) format = 1 [node name="ElevatorButton" parent="." instance=ExtResource( 12 )] -position = Vector2( 874, 441 ) +position = Vector2( 1440, -64 ) [node name="Portal" parent="ElevatorButton" instance=ExtResource( 6 )] position = Vector2( 112, -8 ) @@ -106,7 +111,7 @@ next_scene = "res://src/Levels/Actual Level 1.tscn" [node name="Obstacles" type="Node2D" parent="."] visible = false -position = Vector2( 192, -60 ) +position = Vector2( -742, 148 ) [node name="Spikes" parent="Obstacles" instance=ExtResource( 11 )] position = Vector2( 524, 100 ) diff --git a/src/Levels/3 Tutorial Level.tscn b/src/Levels/3 Tutorial Level.tscn index d24f962..dc9c906 100644 --- a/src/Levels/3 Tutorial Level.tscn +++ b/src/Levels/3 Tutorial Level.tscn @@ -80,10 +80,10 @@ wait_time = 20.0 unique_name_in_owner = true [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 2 +frame = 8 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 1 +frame = 7 [node name="Blobby" parent="." instance=ExtResource( 10 )] unique_name_in_owner = true @@ -114,7 +114,7 @@ collision_layer = 8 collision_mask = 8 bake_navigation = true format = 1 -tile_data = PoolIntArray( -1638414, 5, 65540, -1638413, 5, 10, -1638412, 5, 10, -1638411, 5, 10, -1638410, 5, 10, -1638409, 5, 10, -1638408, 5, 10, -1638407, 5, 10, -1638406, 5, 10, -1638405, 5, 10, -1638404, 5, 10, -1638403, 5, 10, -1638402, 5, 10, -1638401, 5, 10, -1703936, 5, 10, -1703935, 5, 10, -1703934, 5, 10, -1703933, 5, 10, -1703932, 5, 10, -1703931, 5, 10, -1703930, 5, 10, -1703929, 5, 10, -1703928, 5, 10, -1703927, 5, 10, -1703926, 5, 10, -1703925, 5, 10, -1703924, 5, 10, -1703923, 5, 10, -1703922, 5, 10, -1703921, 5, 10, -1703920, 5, 10, -1703919, 5, 10, -1703918, 5, 10, -1703917, 5, 10, -1703916, 5, 10, -1703915, 5, 10, -1703914, 5, 10, -1703913, 5, 10, -1703912, 5, 10, -1703911, 5, 10, -1703910, 5, 10, -1703909, 5, 10, -1703908, 5, 10, -1703907, 5, 10, -1703906, 5, 10, -1703905, 5, 10, -1703904, 5, 10, -1703903, 5, 10, -1703902, 5, 10, -1703901, 5, 10, -1703900, 5, 10, -1703899, 5, 10, -1703898, 5, 10, -1703897, 5, 10, -1703896, 5, 10, -1703895, 5, 10, -1703894, 5, 10, -1703893, 5, 10, -1703892, 5, 10, -1703891, 5, 10, -1703890, 5, 65541, -1572878, 5, 7, -1638354, 5, 6, -1507342, 5, 7, -1572818, 5, 6, -1441806, 5, 7, -1507282, 5, 6, -1376270, 5, 7, -1441746, 5, 6, -1310734, 5, 7, -1376210, 5, 6, -1245198, 5, 7, -1310674, 5, 6, -1179662, 5, 7, -1245138, 5, 6, -1114126, 5, 7, -1179648, 5, 1, -1179647, 5, 2, -1179646, 5, 2, -1179645, 5, 2, -1179644, 5, 2, -1179643, 5, 2, -1179642, 5, 2, -1179641, 5, 2, -1179640, 5, 2, -1179639, 5, 2, -1179638, 5, 5, -1179629, 5, 1, -1179628, 5, 3, -1179627, 5, 3, -1179626, 5, 3, -1179625, 5, 3, -1179624, 5, 3, -1179623, 5, 3, -1179622, 5, 4, -1179602, 5, 6, -1048590, 5, 7, -1114112, 5, 6, -1114111, 5, 524298, -1114110, 5, 589824, -1114109, 5, 589824, -1114108, 5, 589824, -1114107, 5, 589824, -1114106, 5, 589824, -1114105, 5, 589824, -1114104, 5, 589824, -1114103, 5, 524297, -1114102, 5, 8, -1114093, 5, 9, -1114092, 5, 10, -1114091, 5, 10, -1114090, 5, 10, -1114089, 5, 10, -1114088, 5, 10, -1114087, 5, 10, -1114086, 5, 65536, -1114066, 5, 6, -983054, 5, 7, -1048576, 5, 6, -1048575, 5, 589828, -1048567, 5, 589829, -1048566, 5, 8, -1048530, 5, 6, -917518, 5, 7, -983040, 5, 6, -983039, 5, 589830, -983038, 5, 589831, -983037, 5, 589831, -983036, 5, 589831, -983035, 5, 589831, -983034, 5, 589831, -983033, 5, 589831, -983032, 5, 589831, -983031, 5, 589832, -983030, 5, 8, -982994, 5, 6, -851982, 5, 7, -917504, 5, 9, -917503, 5, 10, -917502, 5, 10, -917501, 5, 10, -917500, 5, 10, -917499, 5, 10, -917498, 5, 10, -917497, 5, 10, -917496, 5, 10, -917495, 5, 10, -917494, 5, 65536, -917458, 5, 6, -786446, 5, 65538, -786445, 5, 3, -786444, 5, 3, -786443, 5, 4, -851922, 5, 6, -720910, 5, 65540, -720909, 5, 10, -720908, 5, 10, -720907, 5, 65536, -786386, 5, 6, -655376, 5, 524293, -655374, 5, 7, -720850, 5, 6, -589840, 5, 524293, -589838, 5, 7, -655314, 5, 6, -524304, 5, 524293, -524302, 5, 7, -589798, 5, 1, -589797, 5, 3, -589796, 5, 3, -589795, 5, 3, -589794, 5, 3, -589793, 5, 3, -589792, 5, 3, -589791, 5, 3, -589790, 5, 3, -589789, 5, 3, -589788, 5, 3, -589787, 5, 3, -589786, 5, 5, -589778, 5, 6, -458768, 5, 524293, -458766, 5, 7, -524285, 5, 1, -524284, 5, 3, -524283, 5, 3, -524282, 5, 3, -524281, 5, 3, -524280, 5, 3, -524279, 5, 3, -524278, 5, 3, -524277, 5, 3, -524276, 5, 3, -524275, 5, 3, -524274, 5, 3, -524273, 5, 3, -524272, 5, 5, -524262, 5, 9, -524261, 5, 10, -524260, 5, 10, -524259, 5, 10, -524258, 5, 10, -524257, 5, 10, -524256, 5, 10, -524255, 5, 10, -524254, 5, 10, -524253, 5, 10, -524252, 5, 10, -524251, 5, 10, -524250, 5, 65536, -524242, 5, 6, -393232, 5, 524293, -393230, 5, 7, -458749, 5, 9, -458748, 5, 10, -458747, 5, 10, -458746, 5, 10, -458745, 5, 10, -458744, 5, 10, -458743, 5, 10, -458742, 5, 10, -458741, 5, 10, -458740, 5, 10, -458739, 5, 10, -458738, 5, 10, -458737, 5, 10, -458736, 5, 65536, -458706, 5, 6, -327696, 5, 524293, -327694, 5, 7, -393170, 5, 6, -262160, 5, 524293, -262158, 5, 7, -327634, 5, 6, -196624, 5, 524293, -196622, 5, 7, -262098, 5, 6, -131088, 5, 524293, -131086, 5, 7, -196562, 5, 6, -65552, 5, 524293, -65550, 5, 7, -131026, 5, 6, -16, 5, 524293, -14, 5, 7, -65490, 5, 6, 65520, 5, 524293, 65522, 5, 7, 46, 5, 6, 131056, 5, 524293, 131058, 5, 7, 65565, 5, 1, 65566, 5, 3, 65567, 5, 3, 65568, 5, 3, 65569, 5, 3, 65570, 5, 3, 65571, 5, 3, 65572, 5, 3, 65573, 5, 3, 65574, 5, 3, 65575, 5, 5, 65582, 5, 6, 196592, 5, 524293, 196594, 5, 7, 131101, 5, 6, 131102, 5, 196616, 131103, 5, 196616, 131104, 5, 196616, 131105, 5, 196616, 131106, 5, 196616, 131107, 5, 196616, 131108, 5, 196616, 131109, 5, 196616, 131110, 5, 196616, 131111, 5, 8, 131118, 5, 6, 262128, 5, 524293, 262130, 5, 7, 196617, 5, 1, 196618, 5, 3, 196619, 5, 3, 196620, 5, 3, 196621, 5, 3, 196622, 5, 3, 196623, 5, 3, 196624, 5, 3, 196625, 5, 3, 196626, 5, 3, 196627, 5, 3, 196628, 5, 5, 196637, 5, 9, 196638, 5, 10, 196639, 5, 10, 196640, 5, 10, 196641, 5, 10, 196642, 5, 10, 196643, 5, 10, 196644, 5, 10, 196645, 5, 10, 196646, 5, 10, 196647, 5, 65536, 196654, 5, 6, 327664, 5, 524293, 327666, 5, 7, 262153, 5, 9, 262154, 5, 10, 262155, 5, 10, 262156, 5, 10, 262157, 5, 10, 262158, 5, 10, 262159, 5, 10, 262160, 5, 10, 262161, 5, 10, 262162, 5, 10, 262163, 5, 10, 262164, 5, 65536, 262187, 5, 1, 262188, 5, 3, 262189, 5, 3, 262190, 5, 65539, 393200, 5, 524293, 393202, 5, 7, 327723, 5, 6, 458736, 5, 524293, 458738, 5, 7, 393259, 5, 6, 524272, 5, 524293, 524274, 5, 65538, 524275, 5, 2, 524276, 5, 2, 524277, 5, 2, 524278, 5, 2, 524279, 536870917, 2, 524280, 536870917, 2, 524281, 536870917, 2, 524282, 536870917, 2, 524283, 536870917, 2, 524284, 536870917, 2, 524285, 536870917, 2, 524286, 536870917, 2, 524287, 536870917, 2, 458752, 536870917, 2, 458753, 5, 3, 458754, 5, 3, 458755, 5, 3, 458756, 5, 3, 458757, 5, 3, 458758, 5, 3, 458759, 5, 3, 458760, 5, 3, 458761, 5, 3, 458762, 5, 3, 458763, 5, 3, 458764, 5, 3, 458765, 5, 3, 458766, 5, 3, 458767, 5, 3, 458768, 5, 3, 458769, 5, 3, 458770, 5, 3, 458771, 5, 3, 458772, 5, 3, 458773, 5, 3, 458774, 5, 3, 458775, 5, 3, 458776, 5, 3, 458777, 5, 3, 458778, 5, 3, 458779, 5, 3, 458780, 5, 3, 458781, 5, 3, 458782, 5, 3, 458783, 5, 3, 458784, 5, 3, 458785, 5, 3, 458786, 5, 3, 458787, 5, 3, 458788, 5, 3, 458789, 5, 3, 458790, 5, 3, 458791, 5, 3, 458792, 5, 3, 458793, 5, 3, 458794, 5, 3, 458795, 5, 65539, 589808, 5, 524293, 655344, 5, 524293, 655345, 5, 524293, 655346, 5, 524293, 655347, 5, 524293, 655348, 5, 524293, 655349, 5, 524293, 655350, 5, 524293, 655351, 5, 524293, 655352, 5, 524293, 655353, 5, 524293, 655354, 5, 524293, 655355, 5, 524293, 655356, 5, 524293, 655357, 5, 524293, 655358, 5, 524293, 655359, 5, 524293, 589824, 5, 524293, 589825, 5, 524293, 589826, 5, 524293, 589827, 5, 524293, 589828, 5, 524293, 589829, 5, 524293 ) +tile_data = PoolIntArray( -1638414, 5, 65540, -1638413, 5, 10, -1638412, 5, 10, -1638411, 5, 10, -1638410, 5, 10, -1638409, 5, 10, -1638408, 5, 10, -1638407, 5, 10, -1638406, 5, 10, -1638405, 5, 10, -1638404, 5, 10, -1638403, 5, 10, -1638402, 5, 10, -1638401, 5, 10, -1703936, 5, 10, -1703935, 5, 10, -1703934, 5, 10, -1703933, 5, 10, -1703932, 5, 10, -1703931, 5, 10, -1703930, 5, 10, -1703929, 5, 10, -1703928, 5, 10, -1703927, 5, 10, -1703926, 5, 10, -1703925, 5, 10, -1703924, 5, 10, -1703923, 5, 10, -1703922, 5, 10, -1703921, 5, 10, -1703920, 5, 10, -1703919, 5, 10, -1703918, 5, 10, -1703917, 5, 10, -1703916, 5, 10, -1703915, 5, 10, -1703914, 5, 10, -1703913, 5, 10, -1703912, 5, 10, -1703911, 5, 10, -1703910, 5, 10, -1703909, 5, 10, -1703908, 5, 10, -1703907, 5, 10, -1703906, 5, 10, -1703905, 5, 10, -1703904, 5, 10, -1703903, 5, 10, -1703902, 5, 10, -1703901, 5, 10, -1703900, 5, 10, -1703899, 5, 10, -1703898, 5, 10, -1703897, 5, 10, -1703896, 5, 10, -1703895, 5, 10, -1703894, 5, 10, -1703893, 5, 10, -1703892, 5, 10, -1703891, 5, 10, -1703890, 5, 65541, -1572878, 5, 7, -1638354, 5, 6, -1507342, 5, 7, -1572818, 5, 6, -1441806, 5, 7, -1507282, 5, 6, -1376270, 5, 7, -1441746, 5, 6, -1310734, 5, 7, -1376210, 5, 6, -1245198, 5, 7, -1310674, 5, 6, -1179662, 5, 7, -1245138, 5, 6, -1114126, 5, 7, -1179648, 5, 1, -1179647, 5, 2, -1179646, 5, 2, -1179645, 5, 2, -1179644, 5, 2, -1179643, 5, 2, -1179642, 5, 2, -1179641, 5, 2, -1179640, 5, 2, -1179639, 5, 2, -1179638, 5, 5, -1179629, 5, 1, -1179628, 5, 3, -1179627, 5, 3, -1179626, 5, 3, -1179625, 5, 3, -1179624, 5, 3, -1179623, 5, 3, -1179622, 5, 4, -1179602, 5, 6, -1048590, 5, 7, -1114112, 5, 6, -1114111, 5, 524298, -1114110, 5, 589824, -1114109, 5, 589824, -1114108, 5, 589824, -1114107, 5, 589824, -1114106, 5, 589824, -1114105, 5, 589824, -1114104, 5, 589824, -1114103, 5, 524297, -1114102, 5, 8, -1114093, 5, 9, -1114092, 5, 10, -1114091, 5, 10, -1114090, 5, 10, -1114089, 5, 10, -1114088, 5, 10, -1114087, 5, 10, -1114086, 5, 65536, -1114066, 5, 6, -983054, 5, 7, -983047, 5, 65542, -983046, 5, 65543, -983045, 5, 65543, -983044, 5, 65544, -1048576, 5, 6, -1048575, 5, 589828, -1048567, 5, 589829, -1048566, 5, 8, -1048530, 5, 6, -917518, 5, 7, -983040, 5, 6, -983039, 5, 589830, -983038, 5, 589831, -983037, 5, 589831, -983036, 5, 589831, -983035, 5, 589831, -983034, 5, 589831, -983033, 5, 589831, -983032, 5, 589831, -983031, 5, 589832, -983030, 5, 8, -982994, 5, 6, -851982, 5, 7, -917504, 5, 9, -917503, 5, 10, -917502, 5, 10, -917501, 5, 10, -917500, 5, 10, -917499, 5, 10, -917498, 5, 10, -917497, 5, 10, -917496, 5, 10, -917495, 5, 10, -917494, 5, 65536, -917458, 5, 6, -786446, 5, 65538, -786445, 5, 3, -786444, 5, 3, -786443, 5, 4, -851922, 5, 6, -720910, 5, 65540, -720909, 5, 10, -720908, 5, 10, -720907, 5, 65536, -786386, 5, 6, -655376, 5, 524293, -655374, 5, 7, -720850, 5, 6, -589840, 5, 524293, -589838, 5, 7, -655314, 5, 6, -524304, 5, 524293, -524302, 5, 7, -589798, 5, 1, -589797, 5, 3, -589796, 5, 3, -589795, 5, 3, -589794, 5, 3, -589793, 5, 3, -589792, 5, 3, -589791, 5, 3, -589790, 5, 3, -589789, 5, 3, -589788, 5, 3, -589787, 5, 3, -589786, 5, 5, -589778, 5, 6, -458768, 5, 524293, -458766, 5, 7, -524285, 5, 1, -524284, 5, 3, -524283, 5, 3, -524282, 5, 3, -524281, 5, 3, -524280, 5, 3, -524279, 5, 3, -524278, 5, 3, -524277, 5, 3, -524276, 5, 3, -524275, 5, 3, -524274, 5, 3, -524273, 5, 3, -524272, 5, 5, -524262, 5, 9, -524261, 5, 10, -524260, 5, 10, -524259, 5, 10, -524258, 5, 10, -524257, 5, 10, -524256, 5, 10, -524255, 5, 10, -524254, 5, 10, -524253, 5, 10, -524252, 5, 10, -524251, 5, 10, -524250, 5, 65536, -524242, 5, 6, -393232, 5, 524293, -393230, 5, 7, -458749, 5, 9, -458748, 5, 10, -458747, 5, 10, -458746, 5, 10, -458745, 5, 10, -458744, 5, 10, -458743, 5, 10, -458742, 5, 10, -458741, 5, 10, -458740, 5, 10, -458739, 5, 10, -458738, 5, 10, -458737, 5, 10, -458736, 5, 65536, -458706, 5, 6, -327696, 5, 524293, -327694, 5, 7, -393170, 5, 6, -262160, 5, 524293, -262158, 5, 7, -327634, 5, 6, -196624, 5, 524293, -196622, 5, 7, -262098, 5, 6, -131088, 5, 524293, -131086, 5, 7, -196562, 5, 6, -65552, 5, 524293, -65550, 5, 7, -131026, 5, 6, -16, 5, 524293, -14, 5, 7, -65490, 5, 6, 65520, 5, 524293, 65522, 5, 7, 46, 5, 6, 131056, 5, 524293, 131058, 5, 7, 65565, 5, 1, 65566, 5, 3, 65567, 5, 3, 65568, 5, 3, 65569, 5, 3, 65570, 5, 3, 65571, 5, 3, 65572, 5, 3, 65573, 5, 3, 65574, 5, 3, 65575, 5, 5, 65582, 5, 6, 196592, 5, 524293, 196594, 5, 7, 131101, 5, 6, 131102, 5, 196616, 131103, 5, 196616, 131104, 5, 196616, 131105, 5, 196616, 131106, 5, 196616, 131107, 5, 196616, 131108, 5, 196616, 131109, 5, 196616, 131110, 5, 196616, 131111, 5, 8, 131118, 5, 6, 262128, 5, 524293, 262130, 5, 7, 196617, 5, 1, 196618, 5, 3, 196619, 5, 3, 196620, 5, 3, 196621, 5, 3, 196622, 5, 3, 196623, 5, 3, 196624, 5, 3, 196625, 5, 3, 196626, 5, 3, 196627, 5, 3, 196628, 5, 5, 196637, 5, 9, 196638, 5, 10, 196639, 5, 10, 196640, 5, 10, 196641, 5, 10, 196642, 5, 10, 196643, 5, 10, 196644, 5, 10, 196645, 5, 10, 196646, 5, 10, 196647, 5, 65536, 196654, 5, 6, 327664, 5, 524293, 327666, 5, 7, 262153, 5, 9, 262154, 5, 10, 262155, 5, 10, 262156, 5, 10, 262157, 5, 10, 262158, 5, 10, 262159, 5, 10, 262160, 5, 10, 262161, 5, 10, 262162, 5, 10, 262163, 5, 10, 262164, 5, 65536, 262187, 5, 1, 262188, 5, 3, 262189, 5, 3, 262190, 5, 65539, 393200, 5, 524293, 393202, 5, 7, 327723, 5, 6, 458736, 5, 524293, 458738, 5, 7, 393259, 5, 6, 524272, 5, 524293, 524274, 5, 65538, 524275, 5, 2, 524276, 5, 2, 524277, 5, 2, 524278, 5, 2, 524279, 536870917, 2, 524280, 536870917, 2, 524281, 536870917, 2, 524282, 536870917, 2, 524283, 536870917, 2, 524284, 536870917, 2, 524285, 536870917, 2, 524286, 536870917, 2, 524287, 536870917, 2, 458752, 536870917, 2, 458753, 5, 3, 458754, 5, 3, 458755, 5, 3, 458756, 5, 3, 458757, 5, 3, 458758, 5, 3, 458759, 5, 3, 458760, 5, 3, 458761, 5, 3, 458762, 5, 3, 458763, 5, 3, 458764, 5, 3, 458765, 5, 3, 458766, 5, 3, 458767, 5, 3, 458768, 5, 3, 458769, 5, 3, 458770, 5, 3, 458771, 5, 3, 458772, 5, 3, 458773, 5, 3, 458774, 5, 3, 458775, 5, 3, 458776, 5, 3, 458777, 5, 3, 458778, 5, 3, 458779, 5, 3, 458780, 5, 3, 458781, 5, 3, 458782, 5, 3, 458783, 5, 3, 458784, 5, 3, 458785, 5, 3, 458786, 5, 3, 458787, 5, 3, 458788, 5, 3, 458789, 5, 3, 458790, 5, 3, 458791, 5, 3, 458792, 5, 3, 458793, 5, 3, 458794, 5, 3, 458795, 5, 65539, 589808, 5, 524293, 655344, 5, 524293, 655345, 5, 524293, 655346, 5, 524293, 655347, 5, 524293, 655348, 5, 524293, 655349, 5, 524293, 655350, 5, 524293, 655351, 5, 524293, 655352, 5, 524293, 655353, 5, 524293, 655354, 5, 524293, 655355, 5, 524293, 655356, 5, 524293, 655357, 5, 524293, 655358, 5, 524293, 655359, 5, 524293, 589824, 5, 524293, 589825, 5, 524293, 589826, 5, 524293, 589827, 5, 524293, 589828, 5, 524293, 589829, 5, 524293 ) [node name="DropThroughPlatforms" type="TileMap" parent="."] tile_set = ExtResource( 13 ) diff --git a/src/UserInterface/Screens/InGameMenu/PauseScreen.gd b/src/UserInterface/Screens/InGameMenu/PauseScreen.gd index 297ebc4..5dfd6d3 100644 --- a/src/UserInterface/Screens/InGameMenu/PauseScreen.gd +++ b/src/UserInterface/Screens/InGameMenu/PauseScreen.gd @@ -2,11 +2,13 @@ extends Control # Smart ist es die notwendigen Resourcen vor dem Skriptstart zu laden onready var signalManager := get_tree().root.get_child(3).get_node("%SignalManager") +onready var levelState := get_tree().root.get_child(3).get_node("%LevelState") onready var current_scene := get_tree().get_current_scene() onready var pause_overlay: ColorRect = get_node("PauseOverlay") onready var pause_title: Label = get_node("PauseOverlay/Title") var paused := false setget set_paused +var block_ui_cancel = false func _ready(): #signalManager.connect("player_died", self, "_on_GlobalState_player_died") @@ -20,12 +22,17 @@ func _on_GlobalState_player_died() -> void: pause_title.text = "You lost" -func _unhandled_input(event: InputEvent) -> void: - # TODO don't match for specific text... why did i even consider that... did I pull that from the tutorial??? - if event.is_action_released("pause") && pause_title.text != "You lost" && !$ControlsMenu.visible: +func _input(event: InputEvent) -> void: + if !event.is_action("pause"): + return + if block_ui_cancel || $"%ControlsMenu".visible: + block_ui_cancel = false + get_tree().set_input_as_handled() + return #not oder ! schaltet einen boolean um #Ist self hier notwendig? - self.paused = not paused + self.paused = not paused + block_ui_cancel = true func set_paused(value: bool) -> void: @@ -38,5 +45,6 @@ func set_paused(value: bool) -> void: func _on_Controls_button_up() -> void: $ControlsMenu.visible = true + block_ui_cancel = true $PauseOverlay.visible = false $"%ProfilesMenu".grab_focus() diff --git a/src/UserInterface/Screens/MainMenu/ControlsMenu/ControlsMenu.gd b/src/UserInterface/Screens/MainMenu/ControlsMenu/ControlsMenu.gd index 57272ac..9b06feb 100644 --- a/src/UserInterface/Screens/MainMenu/ControlsMenu/ControlsMenu.gd +++ b/src/UserInterface/Screens/MainMenu/ControlsMenu/ControlsMenu.gd @@ -19,8 +19,10 @@ func _input(event: InputEvent) -> void: return if block_ui_cancel: block_ui_cancel = false + get_tree().set_input_as_handled() return $"%Back"._on_button_up() + func rebuild(input_profile): _action_list.clear()