Added spawn controller; added collision shape to jet; added yaw left to cpu default to test spawnning
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
class_name Spawner extends Area3D
|
||||
|
||||
|
||||
@export var faction: Globals.Faction = Globals.Faction.NEUTRAL
|
||||
|
||||
var is_available: bool = true
|
||||
var delay_timer: Timer = null
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func _on_area_body_entered(_body: Jet) -> void:
|
||||
if delay_timer:
|
||||
delay_timer.stop()
|
||||
|
||||
delay_timer = null
|
||||
|
||||
func _on_area_body_exited(_body: Jet) -> void:
|
||||
delay_timer = Timer.new()
|
||||
delay_timer.one_shot = true
|
||||
delay_timer.timeout.connect(can_spawn)
|
||||
|
||||
|
||||
func set_can_spawn(availablity: bool = true) -> void:
|
||||
is_available = availablity
|
||||
|
||||
func can_spawn() -> void:
|
||||
is_available = true
|
||||
|
||||
func cannot_spawn() -> void:
|
||||
is_available = false
|
||||
|
||||
func align_to_position(jet: Jet) -> void:
|
||||
jet.global_position = global_position
|
||||
jet.rotation = rotation
|
||||
Reference in New Issue
Block a user