This commit is contained in:
pennyrigate 2025-03-01 18:43:11 -05:00
parent d581ccde06
commit 58807ec142
6 changed files with 142 additions and 1 deletions

18
objects/spring/spring.gd Normal file
View file

@ -0,0 +1,18 @@
extends Node2D
@export var bounce_power = 240.0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_area_2d_body_entered(body: Node2D) -> void:
if body is Player:
body.velocity.y = -bounce_power
%AnimationPlayer.play("bounce")