platformer-game-test/src/Items/Spring.gd
2020-11-04 21:13:24 -05:00

10 lines
216 B
GDScript

extends Node2D
export var thrust:float = 250
func _on_Area2D_body_entered(body: Node) -> void:
if body.name == "Player":
body.boost(Vector2(body._velocity.x, -thrust))
$AnimationPlayer.play("activated")