first draft y-wing and turret
This commit is contained in:
@@ -5,6 +5,7 @@ signal scored()
|
||||
var spawn_positions = null
|
||||
|
||||
var enemy = preload("res://Scenes/enemy_xwing.tscn")
|
||||
var enemy2 = preload("res://Scenes/enemy_ywing.tscn")
|
||||
|
||||
func _ready():
|
||||
randomize()
|
||||
@@ -13,11 +14,11 @@ func _ready():
|
||||
|
||||
func spawn_enemy():
|
||||
var index = randi() % spawn_positions.size()
|
||||
var enemy = enemy.instantiate()
|
||||
enemy.global_position = spawn_positions[index].global_position
|
||||
var enemy2 = enemy2.instantiate()
|
||||
enemy2.global_position = spawn_positions[index].global_position
|
||||
#connect error. unsure why.
|
||||
#enemy.connect("enemy_died", get_tree().current_scene, "scored")
|
||||
add_child(enemy)
|
||||
add_child(enemy2)
|
||||
|
||||
#AI Generated code, doesn't work. connect error
|
||||
#func spawn_enemy():
|
||||
|
||||
Reference in New Issue
Block a user