Page 1 of 1

grid question

PostPosted: Wed Jan 02, 2008 12:09 am
by otro
Hello,
I'd like to make a 16x16 pixels grid that controls all my actors movement ! how can i do this?
if someone got a good script or if this has been already asked in a previous topic, let me know !
thanks by advance!!!!

Re: grid question

PostPosted: Wed Jan 02, 2008 6:21 am
by Fuzzy
Make a global var. call it Step or something. set it to 16.

Now in your keydown events do this
** right arrow**
Code: Select all
x +=Step;


** left arrow**
Code: Select all
x -=Step;


** Up arrow**
Code: Select all
y -=Step;


** down arrow**
Code: Select all
y +=Step;