first draft y-wing and turret

This commit is contained in:
zerothelootrat
2024-06-05 05:05:56 -04:00
parent eb7bca8ad2
commit f8a23dbd96
3 changed files with 150 additions and 5 deletions

View File

@@ -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():