Pac-Man Finite State Machine
Overview
Developed a Finite State Machine (FSM) implementation to model and control the behavior of ghosts in a Pac-Man game. This project demonstrates the application of FSM concepts to game AI, creating more realistic and dynamic enemy behaviors.
Key Features
- State-based Ghost Behavior: Implemented multiple states for ghost AI including chase, scatter, frightened, and idle
- Transition Logic: Created conditional transitions between states based on game events
- Object-oriented Design: Utilized inheritance and polymorphism for extensible ghost behavior
- Visualization: Included visualization of the state machine for debugging and demonstration
- Event-driven Architecture: Designed a system that responds to game events like power pellet consumption
Technical Implementation
- Created a modular FSM framework that can be extended for other game characters
- Implemented state persistence and history tracking
- Developed a clean separation between state logic and rendering
- Integrated collision detection with state transitions
- Documented the architecture using UML diagrams
Technologies Used
- Java
- Object-oriented Programming
- FSM Design Patterns
- Game Development Principles
GitHub Repository
View the source code and documentation on GitHub.
Project Timeline
November 2021
Applications
This project demonstrates how FSMs can be applied to:
- Game AI development
- Character behavior modeling
- Event-driven systems
- Complex logic management in interactive applications
Learning Outcomes
- Practical application of FSM theory
- State management in interactive systems
- Event-driven programming techniques
- Game AI development principles
Contact
For more information about this project or to discuss FSM applications, please contact me.