GodotWIP/script_templates/MovementComponent.gd

43 lines
1.1 KiB
GDScript3

extends %BASE%
## Constants available to you
# UP = -1.0
# DOWN = 1.0
# LEFT = -1.0
# RIGHT = 1.0
# Avalable functions to call
# A Series of helper functions
# go_up():
# go_down():
# go_left():
# go_right():
# stop():
## Other needed variables
# desired_movement_vector: Vector2 - Used to store desired movement depending on the state
# current_movement_state:String - The name of the current State
# Since animactor state machine can actually view properties from this type
# I'm thinking about moving the velocity tracker in here instead of player.
# velocity: Vector2 - Current velocity, you can change this at will but state may modify it
# Declare any other member variables here. Examples:
# var a%INT_TYPE% = 2
# var b%STRING_TYPE% = "text"
# Called every frame. 'delta' is the elapsed time since the previous frame.
# you do not normally need to define this for Actor
#func process(delta%FLOAT_TYPE%)%VOID_RETURN%:
# pass
# For Enemy and NPC Actors:
# should be called on the frame process.
# For Player Actors:
# Should be called on the input process