Closed simhj316 closed 4 years ago
Modified to give pacman a change when eating an energizer
hellpacman.png
Sorry, are you referring to the count in ghost.cpp? It represents being a hellpacman under the conditions of ghosts. So it's hard to erase.
You mean, it's used to check if there are any frightened ghosts, so we know when to draw hell or normal Pacman. The variable "count" is badly named, because it's not clear what it counts and in reality it doesn't count anything, because it's either 0 or 1 (FRIGHTENED or NOT FRIGHTENED). You don't need a separate variable for that, you can just use ghost.state == GHOST_FRIGHTENED.
Also, the way you declared "count", placed between 2 functions, and indented as if it's inside a function, isn't very nice. You should have put it right after "public:", similar to how it's done in the ghost class. And since every ghost has a "count", you should have put it in the ghost class instead, and not in 4 places.
I also checked the image, and it has graphical artifacts (white dots around it), which is very sloppy job...
I merged and fixed all that.
Thank you for your devotion. This experience has given me a good study of cooperation.
Happy to help. Would like to see more stuff from you. :)
The pacman_stay in pacman.cpp is only declared and not initialized. An error occurred when moving to the next level and deleted.