load jets to a collection; wire up cpu controller pattern
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
class_name CPUController extends BaseController
|
||||
|
||||
|
||||
func _controller_message(_event: BaseEvent) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not jets_collection: return
|
||||
|
||||
for jet: Jet in jets_collection.get_children():
|
||||
if jet.controller.control_mode == Globals.ControlMode.PLAYER_MODE:
|
||||
continue
|
||||
|
||||
set_jet_action(jet)
|
||||
|
||||
func set_jet_action(jet: Jet) -> void:
|
||||
jet.controller.cpu.yaw_left()
|
||||
@@ -0,0 +1 @@
|
||||
uid://u1tiecau7p8g
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://gb85fimcn0ya"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://u1tiecau7p8g" path="res://scripts/controllers/cpu_system/cpu_controller.gd" id="1_0c7ho"]
|
||||
|
||||
[node name="cpu_controller" type="Node"]
|
||||
script = ExtResource("1_0c7ho")
|
||||
Reference in New Issue
Block a user