block bouncing a mushroom, now changes its direction, if at an edge.

This commit is contained in:
JHDev2006
2025-09-21 14:03:39 +01:00
parent 321ebb8e6b
commit 6013a7da77
3 changed files with 7 additions and 2 deletions

View File

@@ -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: