Jump to content

Tile based AI movement


DragonflyJones
 Share

Recommended Posts

I have a simple tile based game similar to PacMan. I'm using a path algorithm that always returns the next tile a sprite should navigate to. Think about one of the ghosts moving. I'm having a hard time getting the sprite to stop getting stuck between tiles. I've tried adding velocity and MoveTo but the sprites constantly get stuck.

 

I've also taken the suggestion in the link below and shrunk my sprites a bit but the collisions are still off.

 

http://stackoverflow.com/questions/27785355/moving-a-sprite-along-a-pre-defined-path-in-phaser-io

 

I'm using Arcade physics btw. Any ideas?

Link to comment
Share on other sites

If I was doing Pacman I wouldn't collide the ghosts with the tilemap at all. I would use the map for its underlying data, so the ghosts can track which tile they are on and which tiles are coming up (based on their direction), so you can move them around and such - but I wouldn't actually use the map for collision with them, because they don't actually need it - and it's highly likely to conflict with how they need to be automatically moved.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...