Adding more drone types
This commit is contained in:
parent
0716fd62e8
commit
cfe0fb2e5a
12 changed files with 107 additions and 12 deletions
|
|
@ -1,9 +1,8 @@
|
|||
extends HBoxContainer
|
||||
|
||||
func disable_buttons():
|
||||
## Get all children buttons
|
||||
var buttons = get_children()
|
||||
@onready var buttons = get_children()
|
||||
|
||||
func disable_buttons():
|
||||
## Disable all buttons
|
||||
for button in buttons:
|
||||
button.disabled = true
|
||||
|
|
@ -11,9 +10,6 @@ func disable_buttons():
|
|||
visible = false
|
||||
|
||||
func enable_buttons():
|
||||
## Get all children buttons
|
||||
var buttons = get_children()
|
||||
|
||||
## Enable all buttons
|
||||
for button in buttons:
|
||||
button.disabled = false
|
||||
|
|
@ -21,9 +17,6 @@ func enable_buttons():
|
|||
visible = true
|
||||
|
||||
func reset_button_focus():
|
||||
## Get all children buttons
|
||||
var buttons = get_children()
|
||||
|
||||
## Reset focus on all buttons
|
||||
for button in buttons:
|
||||
button.release_focus()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@ var spawning_type : String = ""
|
|||
@onready var drone_controls = %DroneControls
|
||||
@onready var spawned_drones_container = get_node("SpawnedDrones")
|
||||
@onready var cursor = preload("res://resources/cursors/launch_drone.png")
|
||||
|
||||
# Drones!
|
||||
@onready var test_drone = preload("res://entities/TestDrone.tscn")
|
||||
@onready var director_drone = preload("res://entities/DirectorDrone.tscn")
|
||||
@onready var dancer_drone = preload("res://entities/DancerDrone.tscn")
|
||||
@onready var distractor_drone = preload("res://entities/DistractorDrone.tscn")
|
||||
@onready var collector_drone = preload("res://entities/CollectorDrone.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
Log.pr("Drone Manager Ready...")
|
||||
|
|
@ -23,7 +29,20 @@ func _input(event) -> void:
|
|||
|
||||
func spawn_drone(drone_type : String) -> void:
|
||||
Log.pr("This function will put a " + drone_type + " drone in the world")
|
||||
var new_drone = test_drone.instantiate()
|
||||
|
||||
var new_drone = null
|
||||
# Create a new instance of the drone
|
||||
if drone_type == "director":
|
||||
new_drone = director_drone.instantiate()
|
||||
elif drone_type == "dancer":
|
||||
new_drone = dancer_drone.instantiate()
|
||||
elif drone_type == "distractor":
|
||||
new_drone = distractor_drone.instantiate()
|
||||
elif drone_type == "collector":
|
||||
new_drone = collector_drone.instantiate()
|
||||
else:
|
||||
new_drone = test_drone.instantiate()
|
||||
|
||||
spawned_drones_container.add_child(new_drone)
|
||||
new_drone.position = get_viewport().get_mouse_position()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ func _ready():
|
|||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue