grid movement

johnboymacjohnboymac Member Posts: 33
edited November -1 in Working with GS (Mac)
does anyone have a template\ideas on how to move using a grid?
i.e. to make your player jump in 64 pixel increments to a new location, only if there is not an obstacle there?
I have searched, but couldnt see anything suitable.

any pointers much appreciated.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Here you go.
    http://gamesalad.com/game/play/85409

    Its just a matter of change attributes on the actor's position coordinates depending on the event received(key press, etc).
  • johnboymacjohnboymac Member Posts: 33
    Many thanks for this code monkey. this is exactly what i was after. i was thinking in the right direction, but couldnt quite grasp a way to do this.

    the eventual idea is to have the character move to the next grid square, if its free using an animation rather than a straight jump.
    Im thinking the easiest way is to have a 'mask\invisible' actor that does the checking - such that if the player presses right, i move the mask to the next grid square . if there is a collision, I don't move my actor, if there is no collision i move (interpolate) my actor to the new grid square. (and probably need to ignore events until the move completes.)

    thanks, J
Sign In or Register to comment.