You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
423 B
GDScript
20 lines
423 B
GDScript
extends Node
|
|
|
|
## Nodes
|
|
func get_body_node():
|
|
return $KinematicBody2D
|
|
func get_sprite_node():
|
|
return $KinematicBody2D/AnimatedSprite
|
|
|
|
## Parameters
|
|
func set_gpos(new_pos):
|
|
return get_body_node().set_gpos(new_pos)
|
|
func get_gpos():
|
|
return get_body_node().get_gpos()
|
|
func set_internal_velocity(new_vel):
|
|
get_body_node().set_internal_velocity(new_vel)
|
|
|
|
## Logic
|
|
func animate(animation):
|
|
get_sprite_node().play(animation)
|