Pacman
Controls:
arrows keys - movement
s - start game
p - pause game
r - resume game
shift+r - restart game
Balancing:
Score
To account for how fast pacman can move and easily get the outer pellets at the beginning of the game, the scores were adjusted as follows
- Lowered the points per pellet to 50
- Upped the points lost on ghost hit to -1000
AI
When determining AI movement, the distance between pacman and the ghost is calculated for each component.
Two metrics were added to the ghost AI based on this result.
- Direct Movement
This means moving on the axis of the largest component difference eg component difference (0.1, 0.5) the AI will choose to move along the Y axis
- Correct Direction
Once the axis is determined, the correct direction will decide whether the AI will move towards or away from pacman.
Each ghost has a probability of moving directly towards pacman and a probability of moving in the correct direction. The red ghost is more aggressive while the blue ghost is more aimless
Additional features:
- On a ghost hit, the game pauses for a brief moment before the ghost position is reset to emphasize impact
- When pacman consumes the special pellet, pacman shines between red green and blue by implementing a simple timer that updates the color uniforms in pacman's vertex shader
- When the score increases, the score briefly turns green; if it decreases it briefly turns red
- The special pellet is placed randomly within the maze at the start of every game
Status | Released |
Platforms | HTML5 |
Author | RafNGuevara |
Leave a comment
Log in with itch.io to leave a comment.