PixelFormer | A Platformer #games #animation #music #stories #tutorials #art #all
@Stage\n\n@Player\n\ndefine Color Sensing\nif <touching color (#66004c)?> then\n    broadcast (Next Level v)\n    go to x: (-181) y: (-75)\nend\nif <(y position) < [-179]> then\n    if <(End) = [no]> then\n        go to x: (-181) y: (-75)\n    end\n    if <(End) = [yes]> then\n        go to x: (-12) y: (-53)\n    end\nend\nif <touching color (#ff0000)?> then\n    if <(End) = [no]> then\n        go to x: (-181) y: (-75)\n    end\n    if <(End) = [yes]> then\n        go to x: (-12) y: (-53)\n    end\nend\nif <touching color (#00ff55)?> then\n    set [y velocity v] to [16]\nend\nif <touching color (#a1ffff)?> then\n    set [y velocity v] to [-4]\nend\nif <<touching color (#a1ffff)?> and <key (up arrow v) pressed?>> then\n    set [y velocity v] to [4]\nend\n\ndefine Platform Physics\nchange y by (Y Velocity)\nif <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n    repeat ([abs v] of (Y Velocity) )\n        if <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n            change y by ((-1) * (([abs v] of (Y Velocity) ) / (Y Velocity)))\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <not <(Y Velocity) > [0]>>> then\n        set [y velocity v] to [12]\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    if <not <touching color (#003fff)?>> then\n        change [x velocity v] by (1)\n    else\n        change [x velocity v] by (0.5)\n    end\n    if <(X Velocity) > [7]> then\n        change [x velocity v] by (-1)\n    end\nelse\n    if <(X Velocity) > [0]> then\n        if <not <touching color (#003fff)?>> then\n            change [x velocity v] by (-1)\n        else\n            change [x velocity v] by (-0.5)\n        end\n    end\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    if <not <touching color (#003fff)?>> then\n        change [x velocity v] by (-1)\n    else\n        change [x velocity v] by (-0.5)\n    end\n    if <[-7] > (X Velocity)> then\n        change [x velocity v] by (1)\n    end\nelse\n    if <[0] > (X Velocity)> then\n        if <not <touching color (#003fff)?>> then\n            change [x velocity v] by (1)\n        else\n            change [x velocity v] by (0.5)\n        end\n    end\nend\nchange x by (X Velocity)\nif <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (X Velocity) ) + (1))\n        if <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n            change y by (1)\n        end\n    end\n    if <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n        set y to (Old Y)\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <<<touching color (#009933)?> or <touching color (#995900)?>> or <touching color (#cccccc)?>> then\n                change x by ((-1) * (([abs v] of (X Velocity) ) / (X Velocity)))\n            end\n        end\n    end\n    if <key (up arrow v) pressed?> then\n        if <(X Velocity) < [0]> then\n            set [x velocity v] to [0]\n            if <key (left arrow v) pressed?> then\n                set [x velocity v] to [8]\n                set [y velocity v] to [8]\n            end\n        else\n            set [x velocity v] to [0]\n            if <key (right arrow v) pressed?> then\n                set [x velocity v] to [-8]\n                set [y velocity v] to [8]\n            end\n        end\n    end\nend\n\nwhen I receive [end v]\ngo to x: (-12) y: (-53)\n\nif <(Y Velocity) < [-3]> then\n    change [y velocity v] by (1)\nend\nchange [y velocity v] by (1)\nif <(Y Velocity) < [3]> then\n    change [y velocity v] by (-1)\nend\nchange [y velocity v] by (4)\n\nwhen flag clicked\ngo to [front v] layer\nset [tp 1 v] to [true]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-181) y: (-75)\nset size to (100) %\nforever\n    Platform Physics\n    Color Sensing\nend\n\nforever\n    if <key (space v) pressed?> then\n    end\nend\n\nbroadcast (next level v)\n\n@Platforms\n\nwhen flag clicked\nset [end v] to [no]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\nif <(costume [number v]) = [20]> then\n    set [end v] to [yes]\n    broadcast (end v)\nend\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@music\n\nwhen flag clicked\nstart sound [music v]\n\n
= | Arrow keys to play. Don't touch red and touch violet to go to the next level. Some easter eggs are there, if you don't eat them, you can't go to the next level. \n= |  Everything else in the project itself\n= | If you enjoy, love and fave...\n\n? | Quick question: If 19 cuts are made on a larger cube, how many maximum smaller cubes could be created, if re-arrangement is allowed?\n\nThis was #12 on trending