![]() Additionally, Unicode characters from the Noto Sans Canadian Aboriginal font have been used. GraphicsĪll the visuals in the game consist of ASCII art, which I either created myself or modified from existing sources to suit the game's aesthetic. Consequently, the ghost will be in the general direction of Pac-Man. Since Pac-Man's coordinates change by only one cell each time it moves, updating the BFS algorithm doesn't significantly affect the ghost's position. The algorithm uses a vector to queue (push_back) and dequeue (pop_back) the cells of the map to search for Pac-Man's location. Notably, the red ghost, known as Blinky, tracks the exact position of the player and exhibits the most aggressive behavior. This was done to introduce randomness in the ghost behavior, as otherwise, they would all choose the same path and stick together. To enable the ghosts to track the player, I utilized a simple Breadth-First Search (BFS) algorithm that finds the path to Pac-Man or a nearby block. Orientation random_direction = Orientation(random(eng)) Ghosts Behavior To achieve randomness in map generation, I utilized the C++ random library: This functionality has been implemented using a class named maze. The map is randomly generated based on the dimensions entered by the user, utilizing the Depth-First Search (DFS) algorithm. Additionally, it was crucial to meet all the requirements set by the judges in order to achieve the highest score among the other projects. The main objective of this project was to implement all the features of the original game while adding a touch of creativity, without compromising the speed and functionality of the program. For my final project in the Basic Programming course, I aimed to build a simple and functional version of Pac-Man.Īs mentioned earlier, my goal was to create a simplified version of Pac-Man using C++ and implementing graphics with Unicode and ASCII characters. ![]() It is one of the longest-running, best-selling, and highest-grossing video game franchises in history. Pac-Man is a Japanese video game franchise published in the 1980s.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |