Page 1 of 1

Movment

PostPosted: Tue Aug 12, 2008 10:47 am
by firerfun
I need help.

im trying to make my charcter move in a specific way. the best example i can give would be like the people move in Pokemon or Zelda for GB. like where they move one square at a time. is there a way to do that (i assume there is). i have gone through the tutorials i could find and found nothing.

Thanks

Re: Movment

PostPosted: Tue Aug 12, 2008 10:07 pm
by BlarghNRawr
i think u need an array but im not sure

Re: Movment

PostPosted: Wed Aug 13, 2008 4:22 am
by feral
an array would help, but if your "squares" are all the same size, which I assume, it should just be matter of adding the width/or height of the square to the players position each move..

eg: if your square are 32 pixels wide you should just be able to say
x=x+32
or y=y+32

[EDITED - sorry i put some silly code here -now removed.. if you read it please disregard]

you want to only move one space at a time, you will need to disable the repeat function on any of your key down events so you have to tap the key each time to move square

if this is not what you want let us know.