Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Only C Language, not cpp or c# In this programming assignment, you will implement pacman game in C. The classical single player pacman game that
Only C Language, not cpp or c# In this programming assignment, you will implement pacman game in C. The classical single player pacman game that uses Unicode characters to draw the maze and the characters to the screen. The player will move pacman using arrow keys on the keyboard. The board will be drawn as a fixed maze with pellets in it and the prison at the middle which keeps the ghosts. The game will have 5 ghosts and the pacman. At the game start, the ghosts will initially be trapped in the prison for 10 seconds after which they will exit the prison one after the other. The pacman will start from the bottom middle of the game board. There will be 4 power-ups at the four corners of the game board. If the pacman eats those power-ups, it will be invincible for 10 seconds. Any ghost it eats while it is invincible will be teleported back to the prison in the middle of the maze and will stay there for 10 seconds. There will be two escape passages on each side of the prison. When pacman enters one of these passages it will exit from the other passage at the opposite side of the board. The game will have two difficulty levels. In the easy level, ghosts will simply move randomly. In the hard level, they will chase pacman according to the shortest path algorithm (they will try to minimize their distance to the pacman). A score will be displayed at the top of the game board in the middle. It will increment by 1 for each pellet eaten and by 5 for each ghost eaten. Pacman will have 3 lives in total. If pacman is eaten by a ghost, it will lose one of its lives and all ghosts will be teleported to the prison. The game will continue from its current state. If the pacman loses all of its lives, a "Game over!" message will be written to the screen and the user will be directed to the main menu where the score will be reset back to zero. If pacman eats all the pellets, "You win!" message will be displayed and after 5 seconds, the game will reset without exiting to the main menu where all pellets will be restored, all ghosts teleported back to prison and pacman moved to the bottom middle of the board. The score will not reset in this case. The user should be able to exit to the main menu at any time by pressing M key where a confirmation message will be displayed and if the player confirms, the game state will automatically be saved and the game will exit to the main menu
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started