This project involves the development of a Breakout game using object-oriented design principles, design patterns, and good coding practices. The game is based on the classic arcade game developed by Atari Inc. in 1976.
- Implement the basic game mechanics including paddle control, ball, and basic block structures.
- Extend the game with advanced block types and power-ups.
- Implement a state machine to manage different game states such as main menu, running game, paused game, and game over.
- Illustrates the main classes involved in the game application: Game, LevelLoader, and Player.
- Highlights the relationships and interactions between these classes, providing an overview of the application structure.
- Shows the dynamic interactions between objects in the game design.
- Visualizes the sequence of operations and updates, offering a valuable tool for analyzing the game's behavior.
- Represents individual blocks in the game.
- Manages block life, points awarded for destroying it, collision detection, and destruction.
- Controls paddle movement, ensuring it stays within screen boundaries.
- Handles user input and updates the paddle's position.
- Manages the ball's movement and collision detection with other game elements like the paddle and blocks.
- Updates the ball's position and direction based on interactions.
- Manages power-ups in the game, activating special effects when blocks are hit.
- Handles the logic for various types of power-ups.
- Introduces challenging obstacles that players must navigate.
- Triggers traps or other hazards when hit, which players must avoid or overcome.
The game uses a state machine to handle different game states:
- MainMenu: The starting state where players can choose to start a new game or access settings.
- GameRunning: The state where the game loop is executed.
- GamePaused: The state where the game is temporarily stopped when paused.
- GameOver: The state when the player loses all lives, allowing them to restart or return to the main menu.
- Ensures the game state is instantiated only once, providing a global method and maintaining consistent state throughout the game.
- Facilitates communication between different game elements such as the game engine, state machine, and user interface.
- Single Responsibility: Each class has a distinct responsibility (e.g., Game, StateMachine, and Score classes).
- Open/Closed: The Block class is extendable through subclasses.
- Liskov Substitution: Game state classes implement the IGameState interface.
- Interface Segregation: The IGameEventProcessor interface exemplifies this principle.
- Dependency Inversion: Game and BreakoutBus classes rely on abstractions.
Spillet giver en hjemme skærm der giver spillerne mulighed for at vælge mellem en række udfordrende levels.
Her ser vi de grundlæggende Breakout-spiloplevelse der viser paddle boldens og blokkene som spillerne skal ødelægge for at komme videre til de næste niveauer.
Spillet inkluderer forskellige power-ups der forbedrer gameplay ved at give midlertidige fordele.
To run the game, follow these steps:
- Open your terminal or command prompt.
- Navigate to the
Breakout
directory:cd Breakout
- Build and run the game using the .NET CLI:
dotnet run --build
The essential components of the game have been implemented using object-oriented programming principles, ensuring a modern and engaging Breakout game experience.