Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Redical |
Hello!
I’m making a 2D Tower Defence game off of Game Development Center’s tutorial series:
https://www.youtube.com/watch?v=JBQgmy3Oiw4&list=PLZ-54sd-DMAJltIzTtZ6ZhC-9hkqYXyp6&index=7 (This is part four, which is the part I’m up to)
And I’ve had a few errors, but I figured most of them out, except this:
Wave Functions
func start_next_wave():
var wave_data = retreive_wave_data()
yield(get_tree().create_timer(0.2),“timeout”)
spawn_enemies(wave_data)
func retreive_wave_data():
var wave_data = [[“BlueTank”], 0.7, [“BlueTank”, 0.1]]
current_wave += 1
enemies_in_wave = wave_data.size()
return wave_data
func spawn_enemies(wave_data):
for i in wave_data:
var new_enemy = load(“res://Scenes/Enemies/” + i[0] + “.tscn”).instance()
map_node.get_node(“Path”).add_child(new_enemy, true)
yield(get_tree().create_timer(i[1]),“timeout”)
And every time I try to run the actual game it says:
Invalid get index ‘1’ (on base: ‘Array’).
Any ideas why is says this error? I can give more info if necesary.