Initial commit of base flight game project
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class_name CPU extends Node
|
||||
|
||||
|
||||
func process(_delta: float) -> String:
|
||||
return ""
|
||||
|
||||
func physics_process(_delta: float) -> String:
|
||||
return ""
|
||||
|
||||
func unhandled_input(_event: InputEvent) -> String:
|
||||
return ""
|
||||
@@ -0,0 +1 @@
|
||||
uid://co4w1q06mtmjx
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://baiynrn3xqvqh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://co4w1q06mtmjx" path="res://scenes/control_modes/cpu.gd" id="1_72ynb"]
|
||||
|
||||
[node name="cpu" type="Node"]
|
||||
script = ExtResource("1_72ynb")
|
||||
@@ -0,0 +1,35 @@
|
||||
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
|
||||
|
||||
@onready var cpu: CPU = $cpu
|
||||
@onready var player: Player = $player
|
||||
|
||||
|
||||
func process(delta: float) -> String:
|
||||
if CPU_MODE == control_mode:
|
||||
return cpu.process(delta)
|
||||
elif PLAYER_MODE == control_mode:
|
||||
return player.process(delta)
|
||||
|
||||
return ""
|
||||
|
||||
func physics_process(delta: float) -> String:
|
||||
if CPU_MODE == control_mode:
|
||||
return cpu.physics_process(delta)
|
||||
elif PLAYER_MODE == control_mode:
|
||||
return player.physics_process(delta)
|
||||
|
||||
return ""
|
||||
|
||||
func unhandled_input(event: InputEvent) -> String:
|
||||
if CPU_MODE == control_mode:
|
||||
return cpu.unhandled_input(event)
|
||||
elif PLAYER_MODE == control_mode:
|
||||
return player.unhandled_input(event)
|
||||
|
||||
return ""
|
||||
@@ -0,0 +1 @@
|
||||
uid://d2hwj8lth1mmo
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b5btmjvj2gosl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d2hwj8lth1mmo" path="res://scenes/control_modes/jet_controller.gd" id="1_chekb"]
|
||||
[ext_resource type="PackedScene" uid="uid://baiynrn3xqvqh" path="res://scenes/control_modes/cpu.tscn" id="2_xyvvi"]
|
||||
[ext_resource type="PackedScene" uid="uid://87s4f2f202g2" path="res://scenes/control_modes/player.tscn" id="3_c27ir"]
|
||||
|
||||
[node name="jet_controller" type="Node"]
|
||||
script = ExtResource("1_chekb")
|
||||
|
||||
[node name="cpu" parent="." instance=ExtResource("2_xyvvi")]
|
||||
|
||||
[node name="player" parent="." instance=ExtResource("3_c27ir")]
|
||||
@@ -0,0 +1,11 @@
|
||||
class_name Player extends Node
|
||||
|
||||
|
||||
func process(_delta: float) -> String:
|
||||
return ""
|
||||
|
||||
func physics_process(_delta: float) -> String:
|
||||
return ""
|
||||
|
||||
func unhandled_input(_event: InputEvent) -> String:
|
||||
return ""
|
||||
@@ -0,0 +1 @@
|
||||
uid://bbugo3nlb76k7
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://87s4f2f202g2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbugo3nlb76k7" path="res://scenes/control_modes/player.gd" id="1_3256j"]
|
||||
|
||||
[node name="player" type="Node"]
|
||||
script = ExtResource("1_3256j")
|
||||
Reference in New Issue
Block a user