Square to Isometric (and back)
Posted on September 12, 2011 at 7:51 PM
Very basic example of converting mouse coordinates to isometric coordinates for both drawing and clicking.
Hold the mouse in one grid and a circle will appear in the same cell of the other grid.
The tricks are:
isoX = sqrX-sqrY;
isoY = (sqrY+sqrX)/2;
sqrX = isoX/2+isoY;
sqrY = -isoX/2+isoY;
Or was it the other way around? :)
(The thing at the bottom was just some extra stuff I needed)
Comments are currently disabled on games.