I am trying to make a grid based game (like Advance Wars).I tried to do movement like this:
when the grid is clicked - move the object horisontal by :absolute value of (grid.X) - object.X pixels
and vertical by: absolute value of (grid.Y) - object.Y pixels
Since the program wont do both things one after another in one event (I dont know why by the way) I tried deleting the "move vertical" action.Then I added a global variable "timer" that gets -1 every second when grid is clicked,and set that timer to
(absolute value of (grid.X) - object.X pixels) / 64. when grid is clicked.
Finnaly when the timer reaches 0 move the object vertical by : absolute value of (grid.Y) - object.Y pixels.But the timer is messed up and doesnt work as it should.When it gets to 1 it quickly goes to zero before a second finishes and the object doesnt go vertical.
Heres the .cap file : http://www.hostmyfilez.com/j430e779alqx/Grid.cap
Ignore the bookmarked events,I dont think they cause the problem.
Any help would be greatly appreciated.