It might not be easy for someone without coding experience to create. Have a look at https://github.com/NoelFB/Celeste/blob/master/Source/Player/...
It might not be easy for someone without coding experience to create. Have a look at https://github.com/NoelFB/Celeste/blob/master/Source/Player/...
I would think the author was a novice programmer, but looking at the creator's history they've already made Towerfall, another hugely acclaimed game (and one I still play to this day), about 5 years before this was released.
Yet the game itself is extremely polished.
I kind of have no idea where to take this thought, except that successful auters have very different sensibilities than garden variety programmers.
that's because these best practices aren't geared towards producing something good - it's geared towards making something easy to understand for someone else, and easy to maintain when requirements change.
It is also designed for the lowest common denominator programmers - so that many can work on the same code base, over a long period of time.
For games, none of these goals matter at all.
Here's the base Source Engine movement code for example: https://github.com/VSES/SourceEngine2007/blob/master/src_mai...
switch (index)
{
case 0: return sound0;
case 1: return sound1;
case 2: return sound2;
case 3: return sound3;
case 4: return sound4;
}You could argue that having `sound` as an array, and index into that array is better, but once again, what does "better" mean here?
this code works as is, you will not get an array index out of bounds error. If this is quick and easy to write, what else could you ask for?
The end result looks complicated but no sort of specialized engineering skill seems necessary to achieve the result. Just grit and design talent.