Wired up player controls to jet control surfaces; additional jet factory and game mode work
This commit is contained in:
@@ -4,7 +4,10 @@ class_name JetController extends Node
|
||||
const CPU_MODE: int = 0
|
||||
const PLAYER_MODE: int = 1
|
||||
|
||||
@export_enum("CPU:0", "PLAYER:1") var control_mode: int = PLAYER_MODE
|
||||
@export_enum(
|
||||
"CPU:0",
|
||||
"PLAYER:1"
|
||||
) var control_mode: int = PLAYER_MODE
|
||||
|
||||
@onready var cpu: CPU = $cpu
|
||||
@onready var player: Player = $player
|
||||
|
||||
@@ -2,18 +2,22 @@ class_name Player extends Node
|
||||
|
||||
|
||||
func process(_delta: float) -> String:
|
||||
if Input.is_action_just_pressed("pull_up"):
|
||||
if Input.is_action_pressed("pull_up"):
|
||||
return "pull_up"
|
||||
if Input.is_action_just_pressed("push_down"):
|
||||
if Input.is_action_pressed("push_down"):
|
||||
return "push_down"
|
||||
if Input.is_action_just_pressed("yaw_left"):
|
||||
if Input.is_action_pressed("yaw_left"):
|
||||
return "yaw_left"
|
||||
if Input.is_action_just_pressed("yaw_right"):
|
||||
if Input.is_action_pressed("yaw_right"):
|
||||
return "yaw_right"
|
||||
if Input.is_action_just_pressed("roll_left"):
|
||||
if Input.is_action_pressed("roll_left"):
|
||||
return "roll_left"
|
||||
if Input.is_action_just_pressed("roll_right"):
|
||||
if Input.is_action_pressed("roll_right"):
|
||||
return "roll_right"
|
||||
if Input.is_action_pressed("throttle_up"):
|
||||
return "throttle_up"
|
||||
if Input.is_action_pressed("throttle_down"):
|
||||
return "throttle_down"
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user