summaryrefslogtreecommitdiff
path: root/world.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-09-02 23:36:00 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-09-02 23:36:00 +0200
commit7d7d845e76f78a87cf87c9464d700e52cd88ce6f (patch)
tree4d2fc8cd2f8b5b7b0a142c596155de095e1915a2 /world.gd
parent14e51610a66099af5cba7cb92876e691fe017216 (diff)
next commit
Diffstat (limited to 'world.gd')
-rw-r--r--world.gd45
1 files changed, 6 insertions, 39 deletions
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):