diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-09 13:56:46 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-09 13:56:46 +0200 |
commit | 72174f8aa1d75707d8a9358c24771054da46b167 (patch) | |
tree | 9fcbf2e4cfa9b15bbea376cda0c4805304ad9c2f /Hex.gd | |
download | godot-hexgrid-72174f8aa1d75707d8a9358c24771054da46b167.zip godot-hexgrid-72174f8aa1d75707d8a9358c24771054da46b167.tar.gz |
Initial commit
Diffstat (limited to 'Hex.gd')
-rw-r--r-- | Hex.gd | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -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) |