Hovers and Clicks
Pointing at stuff and having it make sense
Another small update, as I've been sick for a week and I'm super tired in the hours after work.
One update to start off with is that I added a translation layer to turn the board location coordinates I figured out in my last update into hex grid coordinates (shown in the top left corner):
I then got mouse clicks wired up so that those also got translated to hex grid coordinates. I emit them with a Godot signal (which nothing listens for yet), and then just print it to the console for now, as you can see here:
All of mouse pointing/hovering/clicking code is contained within a single script file that simply extends Node, as it has no spacial data whatsoever. The script is attached to a single Node in my scene, and it monitors mouse position on every frame. It also scans for left-clicks and emits those as well, when they are at a valid hex grid coordinate.
Next up is connecting the clicked and hovered signals to the Swift rules engine, where decisions are made about legality and what the click does.