djog / tank_battalion

Tank Battalion recreation by DJOG Uno's 2020 in processing.
GNU General Public License v3.0
3 stars 0 forks source link

#37 Added state system #40

Closed rijkvp closed 3 years ago

rijkvp commented 3 years ago

I implemented the state machine pattern and it works nicely! fixes #37

rijkvp commented 3 years ago

I commented out the collision debug because it was not working anymore since the draw & update code are seperated in #33

rijkvp commented 3 years ago

I think this is done as cleanly as can be done, with code that has been moved to different places. We'll let a newbie remove the commented-out lines 👍

I am unsure, but I do think StateManager can also simple be called Game, as (1) one can say: 'a game has a state', (2) it feels more expressive to me (what does a manager do exactly?). Maybe we can even get rid of the globals 👍.

I leave that up to Rijk and future Issues: these changes on themselves are a cleanly performed architectural next step 👍

A state manager manages the states of the game 😉. In processing you need to implement the setup() and draw() functions so I don't think we can get rid of the globals sadly 🤔. If it was possible to put everything in one game class I should have simply called Game.