How to make a 2d game

Pages: 12
That's just unnecessary complexity added to an otherwise simple construct. There will likely only be a few different game states anyway.
Unnecessary complexity? Hardly so. You are already implementing some form of polymorphism with the switch statement, you're just not using the actual power of the language to accomplish it.
I'm all for wrapping up the switch into a nice AI class, but why represent individual states as objects? If the goal is extensibility and scripting AI then use rule systems instead.
Topic archived. No new replies allowed.
Pages: 12