This repository has been archived on 2024-07-02. You can view files and clone it, but cannot push or open issues or pull requests.
HoppyEaster/Scripts/GameManager.gd

22 lines
564 B
GDScript

extends Node2D
@export var map_generator : Node
@export var bunny_generator : Node
var bunnys = []
var gen_data : Dictionary
var wave := 0
func _ready():
gen_data = map_generator.generate() as Dictionary
print("time for generation: " + str(gen_data.time))
pass
func _process(delta):
if(bunnys.size() == 0):
wave += 1
bunnys = bunny_generator.spawn_wave(gen_data.free_tiles.duplicate(), TEAM.EVIL, wave * 500, 3)
for bunny in bunnys:
bunny.sub_on_death(func(bunny): bunnys.erase(bunny))
bunny.sub_on_death(func(bunny): bunny.queue_free())
pass