8 ms·
Awesome game. Good to see the code is authentically bad for an indie game of that era.
by rafram 1y ago
Awesome game. Good to see the code is authentically bad for an indie game of that era.
- oofabz 1y agoAuthentically bad is a good way to put it. My favorite part is the 3300 line Game::updatestate() function and its gigantic switch statement.
- alt227 1y ago> case 4099: lol! Also I like that every function starts with: >jumpheld = true;
- matheusmoreira 1y agoI think it's pretty charming. Games have so much abstraction these days it feels like there's no way to truly understand what it is they're even doing. One can spend months agonizing over the true nature of things and how ideas and concepts relate to each other and eventually distill it all into some object oriented organization that implements not just your game but all possible games. One can also just cycle the game's state machine in a big function, haha switch statement go brrr. Reminds me of the old NES games which would statically allocate memory for game objects, very much in the "structure of arrays" style, they too had game logic just like that. Also reminds me of old electromechanical pinball machines. You can literally see the machine cycle. https://youtu.be/ue-1JoJQaEg https://youtu.be/ue-1JoJQaEg https://youtu.be/E3p_Cv32tEo https://youtu.be/E3p_Cv32tEo
- oneeyedpigeon 1y agoHoly... all wrapped in an if statement too!
- valtism 1y agoIt was originally written in flash, then ported to C++ which would explain some (not all) of the badness.
- tomgp 1y agoI find the code genuinely inspiring. A lesson that being precious about code quality is not always the best way forward.
- endemic 1y agoYeah, code is a means to an end.
- neuroelectron 1y agoThere's nothing wrong with this code. It's called loop unrolling and it keeps the game performant.
- rafram 1y agoHah. Unroll your loops manually to give the compiler a break!
- neuroelectron 1y agoExceelnt sgugstion