|
-
Heli Attack!
 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
-
Pumpkin Carving 2008
 Originally Posted by iopred
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|