martian-mike/scripts/jump_pad.gd

12 lines
282 B
GDScript3
Raw Normal View History

2024-11-02 07:50:32 +01:00
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.