47 lines
1.1 KiB
GDScript
47 lines
1.1 KiB
GDScript
class_name CPU extends Node
|
|
|
|
|
|
var command: Globals.ControllerCommand = Globals.ControllerCommand.NONE
|
|
var throttle: Globals.ControllerCommand = Globals.ControllerCommand.NONE
|
|
|
|
|
|
func process(_delta: float) -> Globals.ControllerCommand:
|
|
return command
|
|
|
|
func physics_process(_delta: float) -> Globals.ControllerCommand:
|
|
return command
|
|
|
|
func unhandled_input(_event: InputEvent) -> Globals.ControllerCommand:
|
|
return command
|
|
|
|
|
|
func pull_up() -> void:
|
|
command = Globals.ControllerCommand.PULL_UP
|
|
|
|
func push_down() -> void:
|
|
command = Globals.ControllerCommand.PUSH_DOWN
|
|
|
|
func yaw_left() -> void:
|
|
command = Globals.ControllerCommand.YAW_LEFT
|
|
|
|
func yaw_right() -> void:
|
|
command = Globals.ControllerCommand.YAW_RIGHT
|
|
|
|
func roll_left() -> void:
|
|
command = Globals.ControllerCommand.ROLL_LEFT
|
|
|
|
func roll_right() -> void:
|
|
command = Globals.ControllerCommand.ROLL_RIGHT
|
|
|
|
func throttle_up() -> void:
|
|
throttle = Globals.ControllerCommand.THROTTLE_UP
|
|
|
|
func throttle_down() -> void:
|
|
throttle = Globals.ControllerCommand.THROTTLE_DOWN
|
|
|
|
func throttle_neutral() -> void:
|
|
throttle = Globals.ControllerCommand.NONE
|
|
|
|
func no_action() -> void:
|
|
command = Globals.ControllerCommand.NONE
|