My next task is to create a menu state before the game starts. I was trying to make it simple as possible. I initially started off with if conditions. But after writing the first few if's i noticed this approach is bad.
- Code: Select all
if self.state == 'game':
elif self.state == 'menu':
The plants versus zombies game the forum was doing was the only really example of states in game that i could find. However, when we were doing it, i pretty much felt like i was way over my experience level. A simple game state repo example would be interesting to add to your examples repo....mekire. Anyways, being the fact that i only plan on having a game state and a menu state for this pong game...I dont plan on having more than these states, i was looking at a simple approach to handling game states.