How to create tile-by-tile movement?

I’m new to defold, working on my first project. i’m trying to make a top-down movement system, tile-based, you move one square (4 directions). then enemies move one tile (you can’t move). then you can move one tile again. etc. turn based. easy. except i’m trying to figure out how to do this and all the movement tutorials and help online are for smooth movements in 8 directions with physics? so uh. any help? sorry if this is too basic or unneccesay

My game ‘Astrogue’ from a while back does what you describe, if you want to peruse the source code:

thank you! i’ll check it out!

Maybe I’m thinking too easy: isn’t enough to

  • declare a variable for storing grid size (eg 32 or 64)
  • on input (action pressed) get the direction (eg: up = y +1, down = y -1, left = x -1, right = x +1)
  • always on input set the go position to current go position + direction * grid size
1 Like