diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-09-02 23:36:00 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-09-02 23:36:00 +0200 |
commit | 7d7d845e76f78a87cf87c9464d700e52cd88ce6f (patch) | |
tree | 4d2fc8cd2f8b5b7b0a142c596155de095e1915a2 /world.gd | |
parent | 14e51610a66099af5cba7cb92876e691fe017216 (diff) |
next commit
Diffstat (limited to 'world.gd')
-rw-r--r-- | world.gd | 45 |
1 files changed, 6 insertions, 39 deletions
@@ -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): |