refactor(*): Restructure game into reusable Arena/GameMode architecture with controller-driven ships, adding Free Play and Match modes

This commit is contained in:
Josh Creek
2026-07-18 15:34:11 +01:00
parent 14a8907038
commit 328831df1f
46 changed files with 664 additions and 406 deletions
+49
View File
@@ -0,0 +1,49 @@
class_name PlayerShipController
extends ShipController
# Drives a Ship from the local player's input actions (see project.godot
# [input] and FLIGHT_MANUAL.md).
func get_action() -> ShipAction:
var action := ShipAction.new()
# Forward/Backward thrust (main engines)
if Input.is_action_pressed("move_forward"):
action.thrust.z += 1.0
if Input.is_action_pressed("move_back"):
action.thrust.z -= 1.0
# Strafe thrusters (left/right)
if Input.is_action_pressed("move_left"):
action.thrust.x -= 1.0
if Input.is_action_pressed("move_right"):
action.thrust.x += 1.0
# Vertical thrusters (up/down)
if Input.is_action_pressed("move_up"):
action.thrust.y += 1.0
if Input.is_action_pressed("move_down"):
action.thrust.y -= 1.0
# Yaw (turn left/right around Y axis)
if Input.is_action_pressed("turn_left"):
action.rotation.y += 1.0
if Input.is_action_pressed("turn_right"):
action.rotation.y -= 1.0
# Pitch (nose up/down around X axis)
if Input.is_action_pressed("pitch_up"):
action.rotation.x -= 1.0
if Input.is_action_pressed("pitch_down"):
action.rotation.x += 1.0
# Roll (bank left/right around Z axis)
if Input.is_action_pressed("roll_left"):
action.rotation.z += 1.0
if Input.is_action_pressed("roll_right"):
action.rotation.z -= 1.0
action.turbo = Input.is_action_pressed("turbo")
return action