VVVVVV’s source code is now public, 10 year anniversary jam happening now
It’s always great to be able to study the source code for successful, released, real games.<p>I will note that this is actually the source code of the C++ rewrite! The original game was written in Flash, and this version was apparently written by Simon Roth.<p>My impressions: The source code is a bit of a tangle here. There are magic numbers (<a href="https:&#x2F;&#x2F;wiki.c2.com&#x2F;?MagicNumber" rel="nofollow">https:&#x2F;&#x2F;wiki.c2.com&#x2F;?MagicNumber</a>) all over the place, plenty of god classes (<a href="https:&#x2F;&#x2F;wiki.c2.com&#x2F;?GodClass" rel="nofollow">https:&#x2F;&#x2F;wiki.c2.com&#x2F;?GodClass</a>), and in general you will have to do a bit too much archaeology to figure out what a particular class or member function is supposed to do (the function and class names don’t give you enough, and there are no comments to help out). There are a few WTFs in here, like the &quot;int i, j, j;&quot; in Script.h.<p>THAT SAID, This is not really out of the ordinary for successful, released, real games. It’s not really different in style from the Celeste Player code.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;NoelFB&#x2F;Celeste&#x2F;blob&#x2F;master&#x2F;Source&#x2F;Player&#x2F;Player.cs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NoelFB&#x2F;Celeste&#x2F;blob&#x2F;master&#x2F;Source&#x2F;Player&#x2F;...</a><p>But if you’re writing a game of this size or complexity, I recommend doing some refactoring work along the way. In my experience, this will reduce the amount of insanity in the project towards the second half of the development cycle.<p>But I am always more impressed by ugly code behind a good game than I am by clean code behind an unreleased, unfinished, or unfun game.