From 7d7d845e76f78a87cf87c9464d700e52cd88ce6f Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 2 Sep 2024 23:36:00 +0200 Subject: next commit --- world.gd | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) (limited to 'world.gd') diff --git a/world.gd b/world.gd index 6817412..ef467d1 100644 --- a/world.gd +++ b/world.gd @@ -14,48 +14,15 @@ func _ready(): ] ) - #while true: - #var scene = preload("res://Mob.tscn") - #var mob = scene.instantiate() - #add_child(Game.spawn_mob(mob, $Spawn)) - #await get_tree().create_timer(randi_range(1, 2)).timeout - #await get_tree().create_timer(0.01).timeout + while true: + var scene = preload("res://Mob.tscn") + var mob = scene.instantiate() + add_child(Game.spawn_mob(mob, $Spawn)) + await get_tree().create_timer(randi_range(1, 2)).timeout + await get_tree().create_timer(0.01).timeout #break -func _draw(): - if Game.debug: - var area = Game.path_grid.region - var cell_size = Game.path_grid.cell_size - var offset = Game.path_grid.offset + (Game.path_grid.cell_size / 2) - for row in range(0, area.size.y + 1): - draw_line( - Vector2(offset.x, offset.y + row * cell_size.y), - Vector2(offset.x + area.size.x * cell_size.x, offset.y + row * cell_size.y), - Color(1, 1, 0, 0.25), - 1.0 - ) - for column in range(0, area.size.x + 1): - draw_line( - Vector2(offset.x + column * cell_size.x, offset.y), - Vector2(offset.x + column * cell_size.x, offset.y + area.size.y * cell_size.y), - Color(1, 1, 0, 0.25), - 1.0 - ) - - for row in range(0, area.size.y): - for column in range(0, area.size.x): - if Game.path_grid.is_point_solid(Vector2i(column, row)): - draw_circle( - Vector2( - offset.x + column * cell_size.x + cell_size.x/2, - offset.y + row * cell_size.y + cell_size.y/2 - ), - 1, - Color(1, 1, 0, 0.25) - ) - - func _input(event: InputEvent): if event.is_action_pressed("ui_accept"): for _i in range(0, 1): -- cgit v1.2.3