Skip to content(if available)orjump to list(if available)

VVVVVV Source Code

VVVVVV Source Code

64 comments

·May 6, 2025

throw4847285

Cavanagh is one of my biggest indie game heroes. He's done it all, from weirdo experiments, satirical exercises, addicting arcade games, and games with surprising depth. It just shows that when you have a really good grasp of the medium, there's no reason to be limited by genre. A great game is a great game.

gallerdude

When I was near the end of high school, my family visited London, and I was thinking about being a game dev. So I sent Terry Cavanagh an email, and to my surprise he completely agreed to get lunch.

He was extremely kind, gave me a lot of interesting life advice. I remember him saying that he got most of his ideas just from playing around with mechanics and experimenting a lot, he was never really one to get grand visions.

Anyways, great fellow, glad he opened source V (as he called it).

Daub

> I remember him saying that he got most of his ideas just from playing around with mechanics and experimenting a lot

This is important. Too many people assume that novel ideas come from abstract concepts. Yes they can, but they can equaly arise from playing with the medium.

nonethewiser

Kinda easy to imagine the opposite as well... having some idea and then implementing it and feeling unsatisfied. Especially a game. It may check all the boxes thematically and have the required features but just not feel fun.

Not to say starting with a firm idea is bad... more like it may be hard to avoid playing around and improvising with the medium in any case.

unwind

Wow, that is cool! Did it help/affect your later choices with your career, did you end up a game developer, or at least try it or so? Always fun with closure! :)

null

[deleted]

senand

Quote from https://distractionware.com/blog/2020/01/vvvvvv-is-now-open-..., linked in the article:

--- snip ---

There’s a lot of weird stuff in the C++ version that only really makes sense when you remember that this was made in flash first, and directly ported, warts and all. For example, maybe my worst programming habit is declaring temporary variables like i, j and k as members of each class, so that I didn’t have to declare them inside functions (which is annoying to do in flash for boring reasons). This led to some nasty and difficult to track down bugs, to say the least. In entity collision in particular, several functions will share the same i variable. Infinite loops are possible.

--- snip ---

This sounds so bad, and confirms my prejudice that gaming code is terrible.

nashashmi

This sounds great and confirms my suspicions that gaming coders learn more than standard coders do.

hombre_fatal

That just boils down to the trivial claim that building harder things teaches you more than building simpler things.

Games are one of the hardest things you can build since they have end to end complexity unlike most projects that can be cleanly decomposed into subsystems.

peterldowns

Incredibly fun game, I'm not a huge gamer but I remember buying the Humble Bundle just to get this. One of the few games that I've spent the time to finish. Awesome work, Terry, and thank you for the great times!

btw also fuck you for veni vidi vici, jeez that took me a while!

https://www.youtube.com/watch?v=4CtiY5D6HCs

Gazoche

I remember buying the bundle and thinking "I'll just play that lightweight 2D platformer while waiting for the bigger, more interesting games in the bundle to download"...and then spending the entire evening on it.

devnullbrain

This video fails to capture the experience of making it past each screen but landing on the left

thih9

It happened to me; but I've been through so many failures at that point that I didn't care if it took me one minute or one hour more.

And I remember actually enjoying the process! I was playing on my phone though and took many breaks - I liked this game a lot in this setting.

h2zizzle

I finally got it after a good few hundred tries, iirc. Prep for having the patience to finish Final Fantasy XV's Pitioss dungeon.

My boyfriend at the time (who'd bought VVVVVV for me), on the other hand, was attempting a no-death-all-trinket run. I could never understand just how damn good he was at gaming.

Oh, and PPPPPP (the soundtrack) remains a staple. Especially the associated osu! Stream tracks.

gsliepen

He apologized, didn't he? There was a screen named "I'm sorry" :P

beej71

Everyone who has played this game knows what's behind that video link before they look at it. :)

pezezin

I managed to get all the trinkets, and oh man was that one painful!

But great game all around, I should play it again...

theandrewbailey

I bought the first Humble Bundles. VVVVVV has been sitting around in my Steam library ever since. Guess I'll get around to playing it now.

alterom

I'm ashamed to say that, as much as I appreciate the wonderful game, I gave up :)

hbn

    void Graphics::print_level_creator(...) {
        /* We now display a face instead of "by {author}" for several reasons:
        * - "by" may be in a different language than the author and look weird ("por various people")
        * - "by" will be longer in different languages and break the limit that levels assume
        * - "by" and author may need mutually incompatible fonts, e.g. Japanese level in Korean VVVVVV
        * - avoids likely grammar problems: male/female difference, name inflection in user-written text...
        * - it makes sense to make it a face
        * - if anyone is sad about this decision, the happy face will cheer them up anyway :D */
Hard to argue with that

dang

Related. Others?

Is opening up your source code worth it? Terry Cavanagh thinks it was for VVVVVV - https://news.ycombinator.com/item?id=25727963 - Jan 2021 (16 comments)

Many games are held together by duct tape - https://news.ycombinator.com/item?id=22043156 - Jan 2020 (154 comments)

VVVVVV Source Code Released - https://news.ycombinator.com/item?id=22011465 - Jan 2020 (1 comment)

VVVVVV’s source code is now public, 10 year anniversary jam happening now - https://news.ycombinator.com/item?id=22011358 - Jan 2020 (223 comments)

VVVVVV 60% Off On The Mac App Store This Weekend - https://news.ycombinator.com/item?id=2347676 - March 2011 (1 comment)

jmmv

I’ll take the chance to reference Super Hexagon by the same author. Incredibly fun and addictive game as well while being super simple. I recall reading somewhere that the author spent only a day or so writing it.

And PPPPPP, the soundtrack for VVVVVV, is neat too!

addandsubtract

While on the subject of games from the same author, Dicey Dungeons is an incredible fun game. Similar to a deck building rogue like, but instead of cards, you have dices. There are like six unique characters, multiple challenges per character, the rules keep changing (forcing you to rethink the game), and the game is filled with lots of humor. There's also free DLC and mod content, which I haven't even got to.

WickyNilliams

Love this game. There's also some interesting write ups from the dev about the process. I really enjoyed (despite not being a game dev) this article on how the enemy AI works. https://www.gamedeveloper.com/design/how-enemy-ai-works-in-d...

oneeyedpigeon

That game definitely doesn't get the respect it deserves! It's basically the giant on whose shoulders Balatro stood. Without being the giant :(

tiniuclx

I had no idea Super Hexagon was from the same developer! That was so much fun, while being a very different kind of game to VVVVVV.

I always find it interesting when indie developers pivot to an entirely new genre of game after some initial success, some wonderful gems came out that way (such as Fallen London -> Sunless Sea -> Cultist Simulator).

willis936

I don't have any other reliable way to enter a flow state other than playing super hexagon for ten minutes.

symmetricsaurus

Second this recommendation!

It’s a super fun game to learn. It looks impossible to start out but then your brain adapts. It’s like seeing through the matrix.

gokaygurcan

I've spent so many hours of my life for this game.

Also shared it with many people and made them go crazy. I believe I still have 5 or 6 copies in my Steam inventory. Just in case.

Same for V, SMB, Braid and so many others. Sometimes, all you need is a little inspiration and crappy graphics.

agos

I'll add a shoutout to PPPPPPowerup!, an album of remixes of PPPPPP, and MMMMMM, an album of metal covers of PPPPPP.

kristoff_it

We have it packaged for Zig, just run `zig build` and you can play the game on Linux, macOS and Windows.

https://github.com/allyourcodebase/VVVVVV

damnitbuilds

He confesses to declaring i,j,k in every class so he didn't have to declare them in functions where he used them ( and (not surprisingly) that caused some nasty, difficult bugs ).

Amazing that he ever made a decent game out of code like that!

mystified5016

Pretty much every game has all sorts of horrible nasty hacks. Admittedly, this is one of the worst I've seen.

rafram

Awesome game. Good to see the code is authentically bad for an indie game of that era.

oofabz

Authentically bad is a good way to put it. My favorite part is the 3300 line Game::updatestate() function and its gigantic switch statement.

oneeyedpigeon

Holy... all wrapped in an if statement too!

matheusmoreira

I 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/E3p_Cv32tEo

alt227

> case 4099:

lol!

Also I like that every function starts with:

>jumpheld = true;

valtism

It was originally written in flash, then ported to C++ which would explain some (not all) of the badness.

neuroelectron

There's nothing wrong with this code. It's called loop unrolling and it keeps the game performant.

rafram

Hah. Unroll your loops manually to give the compiler a break!

neuroelectron

Exceelnt sgugstion

tomgp

I find the code genuinely inspiring. A lesson that being precious about code quality is not always the best way forward.

endemic

Yeah, code is a means to an end.

grep_it

There was a period of time in my life where I had recently moved to California from Canada and I was desperate for a job. I got a job doing door-to-door sales for Comcast. I hated it. I often sat in my car playing VVVVVV on my phone while shirking my responsibilities. Thank you Terry, for the reprieve.

Centigonal

I remember when a certain someone on an irc channel shared the vvvvvv flash demo with me and some others. That game, that period of time, the early Humble Bundles -- all of that was pretty formative for me. Crazy to think that was almost 15 years ago.

Ros2

I think it was a beta and not a demo but either way, it contained 95% of the game not obfuscated in any way. So I saw the ActionScript code quite a while ago!