The Daily WTF
We’re going to do something a little different. I don’t like to do posts about game related code. Games are entirely about shipping something out the door on tight timelines and tight budgets, and it’s very much the category of “if it works it’s good”. There are exceptions, like when you ship an actual WTF, but “bad game code” is not really that interesting.
Awhile back, indie game VVVVVV went open source which gives us a picture of how the sausage is actually made. Now, this is emphatically not a WTF, this isn’t wrong or a mistake, this is just the kind of thing that gets a game shipped, especially when it’s a small budget indie game, by basically one person.
So instead of getting angry or annoyed, let’s just marvel at this 3,440 line switch which represents the game’s main loop.
switch(state) { case 0: //Do nothing here! Standard
To read the full article click on the 'post' link at the top.