Grid based movement

Does anyone know of a template or general idea for grid-based movement? The Boxed-In games and many others employ this.

My primary thoughts are to create a 2d array that holds numbers corresponding to corridor/wall/water, etc. Then give my character an x position and y position value, and so for example, if I press the button to go right, I check the x+1 position in the array and if it returns the number for corridor then I do a transition/animation on my character and update the position values. Am I close? (In my game there is no “physics” involved, just positional logic). At any rate a tutorial would be useful.

Thanks!
Dane
aka dogfish apps

p.s. I just went pro with Corona! This company and community is phenomenal! [import]uid: 117490 topic_id: 20303 reply_id: 320303[/import]

Hey Dane,

Your method sounds solid :slight_smile:

I’m not aware of any tutes or templates that employ this but will certainly keep my eye out for you.

Grats on going Pro! :smiley:

Peach :slight_smile: [import]uid: 52491 topic_id: 20303 reply_id: 79367[/import]