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()
|
||||
Reference in New Issue
Block a user