summaryrefslogtreecommitdiffstats
path: root/Main.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-09 17:03:28 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-09 17:03:28 +0200
commitdf57b3be4e9a8c3ed3d5d14b4b4f1e2ef7629cd3 (patch)
tree7a2a8e9f8f6c3a548442229e58168f1293db4baa /Main.gd
parent857e8831cf4e25b487a1c390e1f32cef2ca2554d (diff)
downloadgodot-hexgrid-df57b3be4e9a8c3ed3d5d14b4b4f1e2ef7629cd3.zip
godot-hexgrid-df57b3be4e9a8c3ed3d5d14b4b4f1e2ef7629cd3.tar.gz
implement different terrain type, use elevation, and height to compute LOS
Diffstat (limited to 'Main.gd')
-rw-r--r--Main.gd6
1 files changed, 3 insertions, 3 deletions
diff --git a/Main.gd b/Main.gd
index 7de0300..36affaa 100644
--- a/Main.gd
+++ b/Main.gd
@@ -10,12 +10,12 @@ onready var Camera : Camera2D = $ViewportContainer/Viewport/Camera
func _ready():
UI.get_node("rotate").connect("pressed", Map, "on_rotate")
Map.connect("configure", Camera, "on_configure")
- Map.connect("touched", self, "on_touched")
+ Map.connect("hex_touched", self, "on_hex_touched")
Camera.window = $ViewportContainer/Viewport.size
Map.on_rotate()
-func on_touched(s : String) -> void:
- UI.get_node("Label").set_text(s)
+func on_hex_touched(pos : Vector2, hex : Hex, key : int) -> void:
+ UI.get_node("Info").set_text("\n(%d;%d)\n -> %s\n -> %d" % [int(pos.x), int(pos.y), hex.inspect(), key])
func _unhandled_input(event : InputEvent) -> void:
if event is InputEventMouseMotion: