DEVLOG TIME!!!
Added ghosts to the game this session. The ghost AI has 4 behavior types - chaser, ambusher, predictor, and patroller, targeting player based on various positions. Also added A* path finding to have the ghosts go around walls instead of choosing adjacent tiles that are closer to them.
Majority of time in this session was spent debugging the movement. It turned out to be a floating-point problem where, when the ghost speed is not divisible by the tile size (20 px), the pixelX % tileSize is never equal to 0 and therefore the alignment function is never called resulting in the ghost moving for 2 px per frame. Fixed this by making the ghost speed fixed at an integer value (2) that is divisible by 20.
Eating the power pellet causes the ghost to go into the frighten state which makes the ghost turn blue and move randomly. The player receives 200 points and the respawn timer starts when a ghost in the frighten state is eaten.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.