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.

26 lines
612 B
GDScript

1 year ago
extends Node
1 year ago
## Nodes
func get_body_node():
return $KinematicBody2D
func get_sprite_node():
return $KinematicBody2D/AnimatedSprite
1 year ago
func is_player():
return true
1 year ago
## 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)
1 year ago
func get_overlapping_areas():
return get_body_node().get_overlapping_areas()
func get_overlapping_bodies():
return get_body_node().get_overlapping_bodies()
## Logic
func animate(animation):
get_sprite_node().play(animation)