summaryrefslogtreecommitdiffstats
path: root/Hex.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Hex.gd')
-rw-r--r--Hex.gd24
1 files changed, 24 insertions, 0 deletions
diff --git a/Hex.gd b/Hex.gd
new file mode 100644
index 0000000..f06c7bf
--- /dev/null
+++ b/Hex.gd
@@ -0,0 +1,24 @@
+#warning-ignore-all:unused_argument
+extends Tile
+
+class_name Hex, "res://godot/Tile.png"
+
+func inspect() -> String:
+ return "[%d;%d] %s" % [coords.x,coords.y,not blocked]
+
+func block(b : bool) -> void:
+ enable_overlay(0, b)
+
+func is_blocked() -> bool:
+ return is_overlay_on(0)
+
+func block_los(from : Tile, to : Tile, d : float, dt : float) -> bool:
+ return is_blocked()
+
+func show_los(b) -> void:
+ if not b:
+ enable_overlay(1, false)
+ enable_overlay(2, false)
+ else:
+ if blocked: enable_overlay(2, true)
+ else: enable_overlay(1, true)