Grid-based movement like in RPG Maker

Can you make example of fluid grid-based movement, like in RPG Maker series?

Any help? I really need it.

Take your time, I can wait…

actually this is a great question, if anyone has any bits of input, I’d also be interested :slight_smile:
thankyou

Here is a simple example:RPGbasedMovement.zip (4.05 KB)

I’ve made some improvements to it, added collisions, but I have problem with z-sorting.

Also I’m trying to give my game retro feeling, scaling gfx x2, so I’d like to make moving a little bit jumpy, so character would move two pixels at time (in-game pixel is 2x2 square of “real” pixels).

Also sometimes grid alignment isn’t perfect - sometimes character is one or two “real” pixels off.
//edit: Also I think I use word “also” a bit too much :smiley:
rpgmovementimproved.7z (3.75 KB)

You can set the z-order of the object to its Y position + its height.

DO =MyObject.Y() + MyObject.Height() to the z-order of MyObject

Don’t forget to use the For Each Object event.

So just make sure to manually put your object on the right coordinates when the move is over.

You can use the solution suggested by Victor ( In this case, to improve performances, you can set the Z order of the boxes only at the start of the scene, and then just update the Z order of objects which are moving. )
I’ve used another way: If a box Y position if inferior to the character Y position, then the box Z order is set to Character.ZOrder() - 1 ( and on the contrary If a box Y position if superior to the character Y position, then the box Z order is set to Character.ZOrder() + 1 ).

rpgmovementimproved.zip (5.04 KB)