Wow, your advice is truly amazing and quite quick! Kudos to you, I really appreciate it
Hi. There are different ways you can implement piece movement.
The approach I use most often involves vector math:
Yes, I quite like your approach and have used this, although I had to modify it as it was not quite what the game requires (a good piece of homework for me!).
Movement in the battle board is 'free movement' and controlled by each players movement keys/controller, if a direction is pressed, then the piece moves.
Basically, I changed it so that the destination was only 1 pixel in the direction of movement and it continued to move until any other key is pressed.
At the moment, the piece now keeps moving after the key is pressed just once. I actually want to only move on the key down event and stop on the key up event. To do this I understand that I would need to wire up the on_press ( keyboard, key ) and on_release ( keyboard, key ) events.
I don't see these in your GUI objects, so assume that these are not implemented yet? I was trying to figure out how your mouse_press, mouse_release, etc events are wired up to their equivalent on_press ( mouse, button ), on_release ( mouse, button ), etc events, but couldn't see anything. Are these also linked to some dll's for Agen?
I have also come across an issue with the two separate images moving a very different speeds, even while set to the same initial speed. The 'order' piece on the left moves much slower than the chaos piece. It doesn't matter which one I start to move first, it's always the same result.
A minor thing I noticed is that the board is not in focus when you run the application so the keyboard keys don't work until you click on the window (gui_demo.lua):
Yes, this was annoying, needed to get around to that, fixed now, so easy with your GUI!
I think this is happening because you are calling "piece:updatePosition" during "setSelectedObj". Therefore, after the call to "setSelectedObj" the piece is already moved to the destination position. One solution to this would be:
You are correct, fixed using your advice.
That's odd, doesn't look stretched on my computer. Any idea on how to reproduce this?
See this first image, that the text is displaying nice and crisp at the top

Now we select the second tile, it's like the text is zoomed in and not redrawn correctly

Another solution might be to change the selection buffer so that it stores map coords instead of references to objects.
Yes, I might look into this at a later stage.