Colorless - a scrolling platformer
@Stage\n\nwhen [m v] key pressed\n\nset [mouse v] to (join (join [x - ] (round ((mouse x) + (SCROLL_X)))) (join [   ___   y - ] (round ((mouse y) + (SCROLL_Y)))))\nshow variable [mouse v]\n\nwhen flag clicked\nforever\n    play sound [Vexento - Happy Robot v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [level v] to [1]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nif <key (1 v) pressed?> then\n    set [level v] to [1]\nelse\n    if <key (2 v) pressed?> then\n        set [level v] to [2]\n    else\n        if <key (3 v) pressed?> then\n            set [level v] to [3]\n        end\n    end\nend\nbroadcast (Set Up v) and wait\nforever\n    Reset\n    broadcast (Set Up v) and wait\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [die]> then\n        Die Animation\n    else\n        if <(EXIT) = [win]> then\n            Win Animation\n            change [level v] by (1)\n        end\n    end\nend\n\ndefine Tick\ngo to [front v] layer\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <(in air) < [4]>> then\n    set [yv v] to [12]\n    switch costume to (costume3 v)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [xv v] by (-2)\n    switch costume to (costume2 v)\nelse\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        change [xv v] by (2)\n        switch costume to (costume1 v)\n    end\nend\nif <(yv) > [-15]> then\n    change [yv v] by (-1)\nend\nMove X (xv)\nMove Y (yv)\nset [xv v] to ((xv) * (.8))\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\nif <touching (exit v)?> then\n    set [exit v] to [win]\nend\nchange [scroll_x v] by (((x) - (SCROLL_X)) / (5))\nchange [scroll_y v] by ((((y) + (50)) - (SCROLL_Y)) / (5))\nif <(y) < [-1500]> then\n    set [exit v] to [die]\nend\nPosition\n\ndefine Reset\nset rotation style [left-right v]\nset [x v] to [0]\nset [y v] to [-50]\nset [scroll_x v] to [0]\nset [scroll_y v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\npoint in direction (90)\nset [exit v] to []\nshow\nclear graphic effects\n\ndefine Move Y (y)\nchange [in air v] by (1)\nchange [y v] by (y)\nPosition\nif <touching (level v)?> then\n    set [n v] to [0]\n    repeat until <<not <touching (level v)?>> or <(n) > [50]>>\n        change [n v] by (1)\n        if <(yv) > [0]> then\n            change [y v] by (-1)\n        else\n            change [y v] by (1)\n        end\n        Position\n    end\n    set [yv v] to [0]\n    change [y v] by (-5)\n    Position\n    if <touching (level v)?> then\n        set [in air v] to [0]\n    end\n    change [y v] by (5)\n    Position\nend\n\ndefine Move X (x)\nchange [x v] by (x)\nPosition\nif <touching (level v)?> then\n    repeat (10)\n        change [y v] by (1)\n        Position\n        if <not <touching (level v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\n    Position\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <(x) > [0]> then\n            set [xv v] to [-16]\n        else\n            set [xv v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [xv v] to [0]\n    end\n    set [n v] to [0]\n    repeat until <<not <touching (level v)?>> or <(n) = [50]>>\n        if <(x) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n        change [n v] by (1)\n    end\n    if <(x) > [0]> then\n        change [x v] by (-1)\n    else\n        change [x v] by (1)\n    end\n    Position\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL_X)) y: ((y) - (SCROLL_Y))\n\ndefine Die Animation\nset rotation style [all around v]\nset [yv v] to [10]\nrepeat until <(y position) < [-179]>\n    change y by (yv)\n    turn right (5) degrees\n    if <(yv) > [-15]> then\n        change [yv v] by (-1)\n    end\nend\nset rotation style [left-right v]\n\ndefine Win Animation\nset [win turn speed v] to [0]\nset rotation style [all around v]\nrepeat (100)\n    change [win turn speed v] by (1)\n    change [ghost v] effect by (1)\n    turn right (win turn speed) degrees\n    change x by ((([x position v] of [exit v]) - (x position)) / (50))\n    change y by ((([y position v] of [exit v]) - (y position)) / (50))\nend\nhide\n\npoint in direction (-90)\npoint in direction (90)\n\n@Level\n\nwhen I receive [tick v]\nPosition\nswitch costume to (id)\nif <<([abs v] of ((x position) - ((x) - (SCROLL_X))) ) < [1]> and <([abs v] of ((y position) - ((y) - (SCROLL_Y))) ) < [1]>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [set up v]\nif  then\n    delete this clone\nend\nif <(LEVEL) = [1]> then\n    Create Platform (x,y) [0] [0] id: [1]\n    Create Platform (x,y) [480] [0] id: [2]\n    Create Platform (x,y) [960] [0] id: [3]\n    Create Platform (x,y) [1400] [0] id: [4]\n    Create Platform (x,y) [2000] [0] id: [5]\nelse\n    if <(LEVEL) = [2]> then\n        Create Platform (x,y) [0] [0] id: [6]\n        Create Platform (x,y) [480] [0] id: [7]\n    else\n        if <(LEVEL) = [3]> then\n            Create Platform (x,y) [0] [0] id: [8]\n            Create Platform (x,y) [480] [0] id: [9]\n            Create Platform (x,y) [960] [0] id: [10]\n        else\n            if <(LEVEL) = [4]> then\n                Create Platform (x,y) [0] [0] id: [11]\n            end\n        end\n    end\nend\n\ndefine Create Platform (x,y) (x) (y) id: (id)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nset [id v] to (id)\nswitch costume to (id)\n\ndefine Position\ngo to x: ((x) - (SCROLL_X)) y: ((y) - (SCROLL_Y))\n\nset [level v] to [2]\n\nwhen [1 v] key pressed\nset [level v] to [1]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen [2 v] key pressed\nset [level v] to [1]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen [3 v] key pressed\nset [level v] to [1]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\n@Danger\n\nwhen I receive [tick v]\nPosition\nif <<([abs v] of ((x position) - ((x) - (SCROLL_X))) ) < [1]> and <([abs v] of ((y position) - ((y) - (SCROLL_Y))) ) < [1]>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [set up v]\nif  then\n    delete this clone\nend\nif <(LEVEL) = [1]> then\n    Create Obstacle (x,y) [892] [-44] id: [1]\n    Create Obstacle (x,y) [1025] [-44] id: [1]\n    Create Obstacle (x,y) [1555] [-145] id: [1]\n    Create Obstacle (x,y) [2220] [100] id: [1]\n    Create Obstacle (x,y) [2020] [-75] id: [1]\n    Create Obstacle (x,y) [1861] [30] id: [1]\nelse\n    if <(LEVEL) = [2]> then\n        Create Obstacle (x,y) [58] [-150] id: [2]\n        Create Obstacle (x,y) [150] [-150] id: [2]\n        Create Obstacle (x,y) [-40] [-150] id: [2]\n        Create Obstacle (x,y) [200] [-150] id: [2]\n        Create Obstacle (x,y) [349] [-120] id: [4]\n        Create Obstacle (x,y) [704] [-208] id: [5]\n    else\n        if <(LEVEL) = [3]> then\n            Create Obstacle (x,y) [84] [-124] id: [3]\n            Create Obstacle (x,y) [192] [-150] id: [1]\n            Create Obstacle (x,y) [536] [-150] id: [1]\n            Create Obstacle (x,y) ((28) + (536)) [-150] id: [1]\n            Create Obstacle (x,y) ((28) + (564)) [-150] id: [1]\n        end\n    end\nend\n\ndefine Create Obstacle (x,y) (x) (y) id: (id)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (id)\n\ndefine Position\ngo to x: ((x) - (SCROLL_X)) y: ((y) - (SCROLL_Y))\n\n@Exit\n\nwhen I receive [tick v]\nPosition\nif <<([abs v] of ((x position) - ((x) - (SCROLL_X))) ) < [1]> and <([abs v] of ((y position) - ((y) - (SCROLL_Y))) ) < [1]>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [set up v]\nif <(LEVEL) = [1]> then\n    set [x v] to [2309]\n    set [y v] to [261]\nelse\n    if <(LEVEL) = [2]> then\n        set [x v] to [973]\n        set [y v] to [-171]\n    else\n        if <(LEVEL) = [3]> then\n            set [x v] to [1296]\n            set [y v] to [-102]\n        else\n            if <(LEVEL) = [4]> then\n                set [x v] to [43434]\n                set [y v] to [43434]\n            end\n        end\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL_X)) y: ((y) - (SCROLL_Y))\n\nset [x v] to [90]\nset [y v] to [-57]\n\n@Object Template\n\nwhen I receive [set up v]\n\nif  then\n    delete this clone\nend\nif <(LEVEL) = [1]> then\nend\n\ndefine Create Object (x,y) (x) (y) id: (id)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (id)\n\nwhen I receive [tick v]\n\nPosition\nif <<([abs v] of ((x position) - ((x) - (SCROLL_X))) ) < [1]> and <([abs v] of ((y position) - ((y) - (SCROLL_Y))) ) < [1]>> then\n    show\nelse\n    hide\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL_X)) y: ((y) - (SCROLL_Y))\n\nCreate Object (x,y) [replace this with x position] [replace this with y position] id: [replace this with costume#]\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\ngo to [front v] layer\n\n@Sprite1\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nnext costume\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n
use 1 2 and 3 for levels\nhuge bug on 3, when you get there switch to level 1 and immediately to level 3\nPART 2 IS COMING OUT SOON, FOLLOW ME TO KNOW WHEN I POST IT.\n