Moved scripts to scripts folder; added data structure for jets; further control flow work
This commit is contained in:
+14
-34
@@ -1,18 +1,15 @@
|
||||
class_name Jet extends Node3D
|
||||
|
||||
|
||||
const ALLIES_SIDE: int = 0
|
||||
const ALLY_JET = preload("uid://cfcid44xnsbdt")
|
||||
|
||||
const AXIS_SIDE: int = 1
|
||||
const AXIS_JET = preload("uid://d07rxx62esueq")
|
||||
var ALLIES_SIDE: EaglePlus = EaglePlus.new()
|
||||
var AXIS_SIDE: SakerFalcon = SakerFalcon.new()
|
||||
|
||||
@export_enum("CPU:0", "PLAYER:1") var control_mode: int = JetController.CPU_MODE
|
||||
@export_enum("Allies:0", "Axis:1") var CONFLICT_SIDE: int = ALLIES_SIDE
|
||||
@export_enum("Allies:0", "Axis:1") var CONFLICT_SIDE: int = ALLIES_SIDE.CONFLICT_SIDE
|
||||
|
||||
const JET_MODEL: Dictionary = {
|
||||
ALLIES_SIDE: ALLY_JET,
|
||||
AXIS_SIDE: AXIS_JET
|
||||
ALLIES_SIDE.CONFLICT_SIDE: ALLIES_SIDE.MODEL,
|
||||
AXIS_SIDE.CONFLICT_SIDE: AXIS_SIDE.MODEL
|
||||
}
|
||||
|
||||
@onready var camera: Camera3D = $camera
|
||||
@@ -20,7 +17,7 @@ const JET_MODEL: Dictionary = {
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
load_jet(CONFLICT_SIDE)
|
||||
_load_jet(CONFLICT_SIDE)
|
||||
|
||||
if JetController.CPU_MODE == control_mode:
|
||||
set_as_cpu()
|
||||
@@ -31,16 +28,18 @@ func _process(delta: float) -> void:
|
||||
var action = controller.process(delta)
|
||||
if not action: return
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
controller.physics_process(delta)
|
||||
#func _physics_process(delta: float) -> void:
|
||||
#var action = controller.physics_process(delta)
|
||||
#if not action: return
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
controller.unhandled_input(event)
|
||||
#func _unhandled_input(event: InputEvent) -> void:
|
||||
#var action = controller.unhandled_input(event)
|
||||
#if not action: return
|
||||
|
||||
|
||||
func load_jet(type: int = CONFLICT_SIDE):
|
||||
func _load_jet(type: int = CONFLICT_SIDE):
|
||||
add_child( JET_MODEL[type].instantiate() )
|
||||
|
||||
|
||||
func set_as_player():
|
||||
camera.current = true
|
||||
controller.control_mode = controller.PLAYER_MODE
|
||||
@@ -48,22 +47,3 @@ func set_as_player():
|
||||
func set_as_cpu():
|
||||
camera.current = false
|
||||
controller.control_mode = controller.CPU_MODE
|
||||
|
||||
|
||||
func pull_up():
|
||||
pass
|
||||
|
||||
func push_down():
|
||||
pass
|
||||
|
||||
func yaw_left():
|
||||
pass
|
||||
|
||||
func yaw_right():
|
||||
pass
|
||||
|
||||
func roll_left():
|
||||
pass
|
||||
|
||||
func roll_right():
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user