summaryrefslogtreecommitdiffstats
path: root/Tile.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:01:43 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:01:43 +0200
commited517bbfd0e10abd9bc571131188061a7221d103 (patch)
tree1c2d4e6b68f785d1f9be8af3ac30c18ea8f234ad /Tile.gd
parent560b2702f1dfe2836c7127dbae7f7d3b515510c6 (diff)
downloadgodot-hexgrid-ed517bbfd0e10abd9bc571131188061a7221d103.zip
godot-hexgrid-ed517bbfd0e10abd9bc571131188061a7221d103.tar.gz
implement possible_moves()
Diffstat (limited to 'Tile.gd')
-rw-r--r--Tile.gd13
1 files changed, 11 insertions, 2 deletions
diff --git a/Tile.gd b/Tile.gd
index ec9b52c..03f10be 100644
--- a/Tile.gd
+++ b/Tile.gd
@@ -7,6 +7,11 @@ var coords : Vector2
var blocked : bool
var on_board : bool = false
+var acc : int
+var parent : Tile
+var road_march : bool
+var search_count : int
+
func configure(p : Vector2, c: Vector2, o :Array) -> void:
position = p
coords = c
@@ -18,13 +23,17 @@ func configure(p : Vector2, c: Vector2, o :Array) -> void:
add_child(s)
visible = false
+func has_road(a) -> bool:
+ # FIXME
+ return false
+
func block_los(from : Tile, to : Tile, d : float, dt : float) -> bool:
+ print("Tile#block_los() must be overriden in a subclass")
return false
func enable_overlay(i :int, v : bool) -> void:
get_child(i).visible = v
- if v:
- visible = true
+ if v: visible = true
else :
visible = false
for o in get_children():