Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did they use a transpiler or something for the mobile version? Lot of magic numbers and odd code like this

    if (t == 0) t = 0;
    if (t == 1) t = 20;
    if (t == 2) t = 14;
    if (t == 3) t = 15;
    if (t == 4) t = 13;
    if (t == 5) t = 16;
or

    case 17:
        blocks[k].prompt = "Press ENTER to activate terminal";
        if(mobilemenus) blocks[k].prompt = "Activate terminal";
        blocks[k].script = "terminal_warp_1";
        setblockcolour(k, "orange");
        trig=0;
        break;
    case 18:
        blocks[k].prompt = "Press ENTER to activate terminal";
        if(mobilemenus) blocks[k].prompt = "Activate terminal";
        blocks[k].script = "terminal_warp_2";
        setblockcolour(k, "orange");
        trig=0;
        break;
    case 19:
        blocks[k].prompt = "Press ENTER to activate terminal";
        if(mobilemenus) blocks[k].prompt = "Activate terminal";
        blocks[k].script = "terminal_lab_1";
        setblockcolour(k, "orange");
        trig=0;
        break;
from https://github.com/TerryCavanagh/VVVVVV/blob/master/mobile_v...


This just looks like typical game dev code to me. You treat the code like a scratchpad, exploring the space and looking for things that work well. Lots of things written once and never touched again, lots of things written with magic numbers because that makes it easier to delete.


Whenever I look at game source code, I start to realize how all of the crazy speedrun glitches exist


Especially on limited platforms of old, where crazy hacks were necessary to get the game to fit in the cartridge/RAM/CPU speed.


It was hand-ported from Flash. I can imagine it being harder to do better than that in ActionScript especially if it was an older version.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: