Skip to content

Latest commit

 

History

History
31 lines (31 loc) · 1.33 KB

README.md

File metadata and controls

31 lines (31 loc) · 1.33 KB

Pac-Man

This code is of a C++ program that implements a simple game, Pac-Man using the SFML (Simple and Fast Multimedia Library) graphics library.

Summary:

  1. Several functions handle different aspects of the game, such as power-ups, collision detection, and starting the game.
  2. The main function initializes the game window and sets up game objects like the hero, enemies, maze blocks, and pellets.
  3. The game loop updates the positions and velocities of the hero and enemies, clears the screen, and draws objects.
  4. The game logic checks for pellet consumption, power-ups, collisions, and winning conditions.
  5. If a collision occurs without a power boost, the game ends and displays the player's score.
  6. If a collision occurs with a power boost, the collided enemy is eliminated.
  7. If all the pellets are consumed, the player wins the game and the score is displayed.

Note: The code includes file paths specific to the author's system, which might need to be modified to run the code correctly on a different system.