A Flash Developer Resource Site

Results 1 to 20 of 25

Thread: Fast path finding for pacman game

Hybrid View

  1. #1
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    Quote Originally Posted by Squize
    If playerXPos<ghostXPos then the ghost's preferred horizontal move is left, and if playerYPos>ghostYPos then the best vertical direction for it is down.
    This is basically my implementation of Pacman pathfinding, with 4 enemies, it got really hard to avoid them.

    If you feel like sprucing it up a bit, make a couple work like this, and then a couple work simply by going a random direction. Adds some zest
    Christopher Rhodes
    squarecircleco.

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    Quote Originally Posted by iopred
    Quote Originally Posted by Squize
    If playerXPos<ghostXPos then the ghost's preferred horizontal move is left, and if playerYPos>ghostYPos then the best vertical direction for it is down.

    This is basically my implementation of Pacman pathfinding, with 4 enemies, it got really hard to avoid them.

    If you feel like sprucing it up a bit, make a couple work like this, and then a couple work simply by going a random direction. Adds some zest
    I would only do that if every tile in between pacman and ghost were walkables. Given the fact that they are "walls", the ghost can't see pacman.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center