playMaker

Author Topic: Grid Movement (like Pacman)  (Read 3038 times)

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Grid Movement (like Pacman)
« 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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Grid Movement (like Pacman)
« Reply #1 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Grid Movement (like Pacman)
« Reply #2 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?