mirror of
https://github.com/anthonyaxenov/toddler-play.git
synced 2024-11-08 04:08:55 +00:00
13 lines
244 B
GDScript3
13 lines
244 B
GDScript3
|
extends Area2D
|
||
|
|
||
|
const SPRING_FORCE = -460
|
||
|
|
||
|
func _on_body_entered(body):
|
||
|
if body.name == 'Player':
|
||
|
$AnimationPlayer.play('push')
|
||
|
body.velocity.y = SPRING_FORCE
|
||
|
body.get_node('Sprite').play('jump')
|
||
|
else:
|
||
|
$AnimationPlayer.play('idle')
|
||
|
|