martian-mike/scripts/jump_pad.gd
2024-11-02 09:50:32 +03:00

11 lines
282 B
GDScript

extends Area2D
@export var jump_force = 400
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
func _on_body_entered(body: Node2D) -> void:
if body is Player:
animated_sprite_2d.play("jump")
body.jump(jump_force)
pass # Replace with function body.