summaryrefslogtreecommitdiff
path: root/UI/HUD/LevelMap.gd
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-01-02 15:31:54 +0100
committerDaniel Weipert <code@drogueronin.de>2021-01-02 15:31:54 +0100
commit7920e8758506cd46c58ea4889c9f4fb704abfd16 (patch)
treec64c8cf57ef906123d6989742baaee97dcc7947d /UI/HUD/LevelMap.gd
parentebae6d04ffc95c6648e863d3de71835f6cd4be96 (diff)
Level Map HUD and game end trigger
Diffstat (limited to 'UI/HUD/LevelMap.gd')
-rw-r--r--UI/HUD/LevelMap.gd25
1 files changed, 25 insertions, 0 deletions
diff --git a/UI/HUD/LevelMap.gd b/UI/HUD/LevelMap.gd
new file mode 100644
index 0000000..8de38fa
--- /dev/null
+++ b/UI/HUD/LevelMap.gd
@@ -0,0 +1,25 @@
+extends Panel
+
+
+func _ready():
+ Global.connect("level_map_updated", self, "draw")
+ self.draw()
+
+
+func draw():
+ var Cell = load("res://UI/HUD/LevelMapCell.tscn")
+ var Level = get_parent().get_parent() # HUD > Level
+
+ for idx in range(Global.Level_Map.size()):
+ var cell = Cell.instance()
+ cell.level_idx = idx
+ cell.set_rect_size(150/3, 150/3)
+ var column = idx % 3
+ var row = idx / 3
+ cell.rect_position.x = cell.rect_size.x*column
+ cell.rect_position.y = cell.rect_size.y*row
+
+ #if idx == Level.idx:
+ #cell.set_border_width_all(3)
+
+ self.add_child(cell)