summaryrefslogtreecommitdiff
path: root/UI/HUD/LevelMapCell.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/LevelMapCell.gd
parentebae6d04ffc95c6648e863d3de71835f6cd4be96 (diff)
Level Map HUD and game end trigger
Diffstat (limited to 'UI/HUD/LevelMapCell.gd')
-rw-r--r--UI/HUD/LevelMapCell.gd24
1 files changed, 24 insertions, 0 deletions
diff --git a/UI/HUD/LevelMapCell.gd b/UI/HUD/LevelMapCell.gd
new file mode 100644
index 0000000..16ff961
--- /dev/null
+++ b/UI/HUD/LevelMapCell.gd
@@ -0,0 +1,24 @@
+extends Panel
+
+
+var level_idx = 0
+
+
+func _ready():
+ var level = Global.get_level(self.level_idx)
+
+ $ClearMark.text = ""
+ if level.cleared_by.idx == Enum.PLAYER.FIRST:
+ $ClearMark.text = "X"
+ elif level.cleared_by.idx == Enum.PLAYER.SECOND:
+ $ClearMark.text = "O"
+
+ $Time.text = str(level.time) + "s"
+ $Name.text = level.cleared_by.name
+
+
+func set_rect_size(x, y):
+ self.rect_size.x = x
+ self.rect_size.y = y
+ $ClearMark.rect_size.x = x
+ $ClearMark.rect_size.y = y