Files
GrowlerFury/scripts/controllers/cpu_system/cpu_controller.gd
T

29 lines
730 B
GDScript
Raw Normal View History

class_name CPUController extends BaseController
func _process(_delta: float) -> void:
if not jets_collection: return
for jet: Jet in jets_collection.get_children():
if Globals.ControlMode.PLAYER_MODE == jet.controller.control_mode:
continue
process_jet_plan(jet.controller.cpu)
func _controller_message(event: BaseEvent) -> void:
if event is InitSpawnsLoadedEvent:
handle_init_spawns_loaded_event()
func handle_init_spawns_loaded_event() -> void:
for jet: Jet in jets_collection.get_children():
if Globals.ControlMode.PLAYER_MODE == jet.controller.control_mode:
continue
create_jet_plan(jet)
func create_jet_plan(jet: Jet) -> void:
print(jet)
func process_jet_plan(jet: CPU) -> void:
jet.yaw_left()