From 6013a7da77ed10414908c13f3a2adbe8e04c03e9 Mon Sep 17 00:00:00 2001 From: JHDev2006 Date: Sun, 21 Sep 2025 14:03:39 +0100 Subject: [PATCH] block bouncing a mushroom, now changes its direction, if at an edge. --- Scenes/Prefabs/Entities/Items/SuperMushroom.tscn | 2 +- Scripts/Classes/Entities/Items/PowerUpItem.gd | 3 ++- Scripts/Classes/Singletons/SpeedrunHandler.gd | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Scenes/Prefabs/Entities/Items/SuperMushroom.tscn b/Scenes/Prefabs/Entities/Items/SuperMushroom.tscn index 0c8832d..04639f6 100644 --- a/Scenes/Prefabs/Entities/Items/SuperMushroom.tscn +++ b/Scenes/Prefabs/Entities/Items/SuperMushroom.tscn @@ -75,4 +75,4 @@ movement_node = NodePath("../BasicEnemyMovement") metadata/_custom_type_script = "uid://d4a7yp6e55u8t" [connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"] -[connection signal="block_bounced" from="BlockBouncingDetection" to="." method="block_bounce_up" unbinds=1] +[connection signal="block_bounced" from="BlockBouncingDetection" to="." method="block_bounce_up"] diff --git a/Scripts/Classes/Entities/Items/PowerUpItem.gd b/Scripts/Classes/Entities/Items/PowerUpItem.gd index bea1233..c9fb3a4 100644 --- a/Scripts/Classes/Entities/Items/PowerUpItem.gd +++ b/Scripts/Classes/Entities/Items/PowerUpItem.gd @@ -27,7 +27,8 @@ func on_area_entered(area: Area2D) -> void: if area.owner is Player: collect_item(area.owner) -func block_bounce_up() -> void: +func block_bounce_up(block: Node2D) -> void: + direction = -sign(block.global_position.x - global_position.x + 0.1) velocity.y = -200 func block_dispense_tween() -> void: diff --git a/Scripts/Classes/Singletons/SpeedrunHandler.gd b/Scripts/Classes/Singletons/SpeedrunHandler.gd index adf8ad7..faf9bf1 100644 --- a/Scripts/Classes/Singletons/SpeedrunHandler.gd +++ b/Scripts/Classes/Singletons/SpeedrunHandler.gd @@ -337,6 +337,10 @@ func check_for_medal_achievement() -> void: has_silver_levels_any = false if best_level_any_times[i] > LEVEL_GOLD_ANY_TIMES[Global.current_campaign][i] * MEDAL_CONVERSIONS[0]: has_bronze_levels_any = false + else: + has_gold_levels_any = false + has_silver_levels_any = false + has_bronze_levels_any = false var world := 0 for i in best_level_warpless_times: