Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 4ppleseed on April 07, 2015, 04:04:41 PM

Title: Grid Movement (like Pacman)
Post by: 4ppleseed on April 07, 2015, 04:04:41 PM
Hi all,

I did a search for 'grid movement' and found a few threads but none of them seem to get to the bottom of the question.

How do you do grid movement in Playmaker?

Lets say we have 16x16 tiles and they are in a 8x8 grid. It's a top down game like pacman but there are no walls. So, pacman is moving along 1 pixel at a time but when the player presses RIGHT how do we only move right when Pacman is exactly in the middle of a tile?

I don't want to use collisions to squeeze a 16x16 box through a gap - is there another way to do it?

Thanks.
Title: Re: Grid Movement (like Pacman)
Post by: Lane on April 07, 2015, 04:31:44 PM
The same principles of grid based movement system design applies in Playmaker as well, so you could read about the high level application of that sort of thing and get on track with it.

One way is to keep track of which tile he is on and scan the neighbor tiles to see if movement in those directions is allowed. Then when the user presses a direction key you check if it is possible, then move him to that grid point. If it isn't an open grid point then you can't move.
Title: Re: Grid Movement (like Pacman)
Post by: coffeeANDsoda on April 07, 2015, 05:06:24 PM
One way is to keep track of which tile he is on and scan the neighbor tiles to see if movement in those directions is allowed. Then when the user presses a direction key you check if it is possible, then move him to that grid point. If it isn't an open grid point then you can't move.

How is that done with actions though?