Journal   [A platformer]
@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen I receive [start game v]\n\nwhen flag clicked\nset [mute v] to [no]\nswitch backdrop to (background v)\n\n@player\n\nwhen flag clicked\nswitch costume to (default v)\nhide\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Set up v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game-win\n    else\n        Game-die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (100) %\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    change player x by (round (sx))\nend\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-1.5)\nchange player y by (sy)\nset [scroll x v] to (X)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nposition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nTest-die\nif <touching (platforms v)?> then\n    repeat until <not <touching (platforms v)?>>\n        if <(sy) > [0]> then\n            change [y v] by (-1)\n        else\n            change [y v] by (1)\n            set [in air v] to [0]\n        end\n        position\n        set [sy v] to [0]\n    end\nend\n\ndefine position\ngo to x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine change player x by (sx)\nchange [x v] by (sx)\nposition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-10]\n        else\n            set [sx v] to [10]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        position\n    end\nend\n\ndefine Game-die\nset [exit v] to []\nset [y v] to [12.5]\nstart sound [Bonk v]\nrepeat until <(y position) < [-90]>\n    set rotation style [all around v]\n    change [ghost v] effect by (3)\n    go to [front v] layer\n    turn right (10) degrees\n    change y by (y)\n    change [y v] by (-1)\nend\nrepeat until <(y position) < [-178]>\n    set rotation style [all around v]\n    change [ghost v] effect by (3)\n    go to [front v] layer\n    turn right (10) degrees\n    change y by (y)\n    change [y v] by (-1)\nend\nset [dead? v] to [0]\nbroadcast (reset coins v)\nbroadcast (reset coins 2 v)\nbroadcast (reset coins 3 v)\nhide\nchange [your total coins v] by ((COLLECTED) * (-1))\n\ndefine Test-die\nif <<touching (saws v)?> or <<touching (da lava v)?> or <<key (r v) pressed?> or <touching (danger v)?>>>> then\n    set [exit v] to [die]\nend\n\ndefine Game-win\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\nchange [level v] by (1)\nbroadcast (reset coins v)\n\nwhen I receive [trampoline v]\nset [sy v] to [32]\n\nwhen I receive [end game v]\nset [scroll y v] to [-9999]\ngo to [back v] layer\n\nchange [y v] by (15)\n\nwhen I receive [sheriff v]\nswitch costume to (sheriff v)\n\nwhen I receive [devil v]\nswitch costume to (devil v)\n\nwhen I receive [cowboy v]\nswitch costume to (cowboy v)\n\nwhen I receive [bandit v]\nswitch costume to (bandit😎 v)\n\ngo to [front v] layer\n\ngo to [front v] layer\n\ngo to [front v] layer\n\ngo to [front v] layer\n\ngo to [front v] layer\n\nwhen I receive [start game v]\nbroadcast (green flag v) and wait\nbroadcast (Play Game v) and wait\n\nset [exit v] to [die]\n\nset [collected v] to [0]\n\n@platforms\n\nwhen I receive [green flag v]\ngo to [back v] layer\nshow\n\ndefine Postions x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [set up v]\ngo to [front v] layer\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level1 1 v)\nif <(level) = [1]> then\n    switch costume to (level1 1 v)\n    clone at x: [300] y: [0]\n    clone at x: [400] y: [0]\n    clone at x: [500] y: [150]\n    clone at x: [600] y: [0]\nelse\n    if <(level) = [2]> then\n        switch costume to (level2 1 v)\n        clone at x: [550] y: [0]\n        clone at x: [650] y: [0]\n        clone at x: [600] y: [0]\n        clone at x: [400] y: [0]\n    else\n        if <(level) = [3]> then\n            switch costume to (level3 1 v)\n            clone at x: [600] y: [0]\n            clone at x: [650] y: [0]\n            clone at x: [500] y: [0]\n        else\n            if <(level) = [4]> then\n                switch costume to (win v)\n                clone at x: [500] y: [0]\n            end\n        end\n    end\nend\n\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nPostions x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nset [exit v] to [die]\n\n@da lava\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\ndefine postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine postionx: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [tick v]\npostion ((X) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nset [y v] to [0]\nset [x v] to [0]\nif <not <(level) = [999999999]>> then\n    repeat (20)\n        postionx: [450] y: [0]\n    end\nend\n\nwhen I start as a clone\ngo [backward v] (1) layers\nforever\n    set [y v] to (([sin v] of ((timer) * (100)) ) * (10))\nend\n\n@background\n\nwhen flag clicked\nset x to (0)\nset y to (-50)\nforever\n    go to [back v] layer\nend\n\n@saws\n\nwhen I receive [tick v]\nPostions x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\nturn right (10) degrees\n\ndefine Postions x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [set up v]\nset [line v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (main v)\ngo to [back v] layer\nif <(level) = [1]> then\n    clone at x: [263] y: [-40]\n    clone at x: [945] y: [195]\n    clone at x: [205] y: [0]\nelse\n    if <(level) = [2]> then\n        clone at x: [1135] y: [59]\n        clone at x: [0] y: [-95]\n        clone at x: [0] y: [-100]\n    else\n        if <(level) = [3]> then\n            clone at x: [1291] y: [-30]\n            clone at x: [350] y: [-30]\n            clone at x: [95] y: [0]\n        end\n    end\nend\nset [x v] to [99999999]\n\ndefine clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwait (1) seconds\n\n@shadows\n\nwhen I receive [green flag v]\ngo to [back v] layer\nshow\n\nwhen I receive [tick v]\nPostions x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Postions x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [set up v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level1 1 v)\nif <(level) = [1]> then\n    go to [back v] layer\n    clone at x: [300] y: [0]\n    clone at x: [400] y: [0]\n    clone at x: [500] y: [150]\n    clone at x: [600] y: [0]\nelse\n    if <(level) = [2]> then\n        go to [back v] layer\n        switch costume to (coustume3 v)\n        clone at x: [1118] y: [0]\n    else\n        if <(level) = [3]> then\n            switch costume to (costume7 v)\n            clone at x: [600] y: [0]\n            clone at x: [200] y: [0]\n            clone at x: [700] y: [0]\n        end\n    end\nend\n\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nset [ghost v] effect to (50)\nnext costume\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (50)\n\n@textures\n\nwhen I receive [green flag v]\ngo to [back v] layer\nshow\n\nwhen I receive [tick v]\nPostions x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Postions x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [set up v]\ngo to [back v] layer\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level1 1 v)\nif <(level) = [1]> then\n    clone at x: [300] y: [0]\n    clone at x: [400] y: [0]\n    clone at x: [500] y: [150]\nelse\n    if <(level) = [2]> then\n        switch costume to (level2 1 v)\n        clone at x: [550] y: [0]\n        clone at x: [650] y: [0]\n        clone at x: [600] y: [0]\n    else\n        if <(level) = [3]> then\n            switch costume to (costume4 v)\n            clone at x: [600] y: [0]\n            clone at x: [650] y: [0]\n            clone at x: [500] y: [0]\n        end\n    end\nend\n\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@danger\n\nwhen I receive [green flag v]\ngo to [back v] layer\nshow\n\nwhen I receive [tick v]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level1 1 v)\nif <(level) = [1]> then\n    clone at x: [300] y: [0]\n    clone at x: [450] y: [0]\nelse\n    if <(level) = [2]> then\n        switch costume to (level2 1 v)\n        clone at x: [550] y: [0]\n        clone at x: [650] y: [0]\n        clone at x: [600] y: [0]\n    else\n        if <(level) = [3]> then\n            switch costume to (level3 1 v)\n            clone at x: [600] y: [0]\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@trampoline\n\nwhen I receive [green flag v]\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    start sound [Big Boing v]\n    broadcast (trampoline v)\nend\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 \(4\) v)\nif <(level) = [1]> then\n    clone at x: [943] y: [-24]\nelse\n    if <(level) = [2]> then\n        clone at x: [942] y: [-56]\n        clone at x: [500] y: [-45]\n    else\n        if <(level) = [3]> then\n            clone at x: [1543] y: [-25]\n        else\n            if <(level) = [4]> then\n                clone at x: [9999999999999999] y: [0]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\n\nrepeat (5)\n    next costume\nend\nrepeat (5)\n    switch costume to ((costume [number v]) - (1))\nend\n\n@item shop\n\nwhen flag clicked\nset size to (100) %\npoint in direction (90)\ngo to x: (-194) y: (141)\nshow\nswitch costume to (shop icon v)\n\nwhen this sprite clicked\nbroadcast (open shop v)\n\n@welcome\n\nwhen flag clicked\nhide\n\nwhen I receive [hide welcome v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [finish intro v]\nset [stop welcome music v] to [play]\nshow\nrepeat until <(STOP WELCOME MUSIC) = [dont play]>\n    play sound [the way forward v] until done\nend\n\n@playbutton\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (4))\n    else\n        change size by (((100) - (size)) / (4))\n    end\nend\n\nwhen this sprite clicked\nstart sound [Wood Tap v]\ngo to x: (0) y: (0)\npoint in direction (90)\nnext costume\nbroadcast (hide welcome v)\nwait (0.7) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (start game v)\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\n\nwhen I receive [finish intro v]\npoint in direction (90)\nreset timer\nset [ghost v] effect to (0)\nswitch costume to (play button v)\nshow\ngo to [front v] layer\ngo to x: (-45) y: (5)\nforever\n    point in direction ((([sin v] of ((timer) * (100)) ) * (5)) + (90))\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nif <(volume) = [100]> then\n    set [mute v] to [yes]\n    set volume to (0) %\n    switch costume to (muted v)\n    stop all sounds\nelse\n    set [mute v] to [no]\n    switch costume to (umuted v)\n    set volume to (100) %\nend\n\nwhen I receive [play game v]\nset [mute v] to [no]\nswitch costume to (umuted v)\nset volume to (100) %\nshow\nforever\n    if <(mute) = [no]> then\n        play sound [he's a pirate v] until done\n    end\nend\n\n@ur money\n\nwhen flag clicked\nswitch costume to (0 v)\ngo to x: (202) y: (150)\nhide\nforever\n    go to [front v] layer\nend\n\nset [collected v] to [2]\n\nwhen I receive [change how much coins sprite v]\nnext costume\n\nwhen I receive [reset coins v]\nif <(level) = [1]> then\n    switch costume to ((costume [number v]) - (COLLECTED))\nend\n\nwhen I receive [cowboy v]\nchange [your total coins v] by (-5)\nswitch costume to ((costume [number v]) - (5))\n\nwhen I receive [sheriff v]\nchange [your total coins v] by (-7)\nswitch costume to ((costume [number v]) - (7))\n\nwhen I receive [bandit v]\nchange [your total coins v] by (-10)\nswitch costume to ((costume [number v]) - (10))\n\nwhen I receive [devil v]\nchange [your total coins v] by (-10)\nswitch costume to ((costume [number v]) - (10))\n\nwhen I receive [reset coins 2 v]\nif <(level) = [2]> then\n    switch costume to ((costume [number v]) - (COLLECTED))\nend\n\nwhen I receive [patch coins glitch v]\nswitch costume to (0 v)\nset [your total coins v] to [0]\n\nwhen I receive [reset coins 3 v]\nif <(level) = [3]> then\n    switch costume to ((costume [number v]) - (COLLECTED))\nend\n\nset [your total coins v] to [7]\n\nwhen I receive [play game v]\nshow\n\n@coins\n\nwhen I receive [green flag v]\nset [your total coins v] to [0]\npoint in direction (90)\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\nnext costume\nif <touching (player v)?> then\n    broadcast (change how much coins sprite v)\n    start sound [Coin v]\n    change [your total coins v] by (1)\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (open door v)\n    end\n    delete this clone\nend\nif <<(your total coins) = [-1]> or <<(your total coins) = [-2]> or <<(your total coins) = [-3]> or <<(your total coins) = [-4]> or <(your total coins) = [-5]>>>>> then\n    broadcast (patch coins glitch v)\nend\n\nwhen I receive [set up v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (coin1 \(1\) v)\n    clone at x: [283] y: [103]\n    clone at x: [606] y: [9]\n    clone at x: [780] y: [9]\n    clone at x: [1327] y: [295]\n    clone at x: [1495] y: [230]\nelse\n    if <(level) = [2]> then\n        switch costume to (coin1 \(1\) v)\n        clone at x: [198] y: [-5]\n        clone at x: [716] y: [-22]\n        clone at x: [1236] y: [189]\n        clone at x: [1449] y: [187]\n        clone at x: [2121] y: [97]\n    else\n        if <(level) = [3]> then\n            switch costume to (coin1 \(1\) v)\n            clone at x: [196] y: [-17]\n            clone at x: [973] y: [85]\n            clone at x: [1617] y: [169]\n            clone at x: [1731] y: [215]\n            clone at x: [1805] y: [100]\n        else\n        end\n    end\nend\nset [x v] to [-99999]\nswitch costume to (costume1 \(17\) v)\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@shop\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\nset [close da shop now v] to [NO]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen I receive [close shop v]\nhide\n\n@cowboy\n\nwhen flag clicked\nset [equipped cowboy? v] to [no]\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen this sprite clicked\nif <(your total coins) > [4]> then\n    set [equipped cowboy? v] to [yes]\n    broadcast (show cowboy equip v)\n    broadcast (cowboy v)\n    broadcast (close shop v)\n    play sound [REGISTER v] until done\nelse\n    play sound [not enough money :\( v] until done\nend\n\nwhen I receive [close shop v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n        wait (.1) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close shop v]\nhide\n\nwhen this sprite clicked\nif <(your total coins) > [6]> then\n    broadcast (sheriff v)\n    broadcast (close shop v)\n    play sound [REGISTER v] until done\nelse\n    play sound [Clang v] until done\nend\n\n@Sprite4\n\nwhen flag clicked\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n        wait (.1) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close shop v]\nhide\n\nwhen this sprite clicked\nif <(your total coins) > [9]> then\n    broadcast (bandit v)\n    broadcast (close shop v)\n    play sound [REGISTER v] until done\nelse\n    play sound [Clang v] until done\nend\n\n@devil\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n        wait (.1) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close shop v]\nhide\n\nwhen this sprite clicked\nif <(your total coins) > [9]> then\n    broadcast (devil v)\n    broadcast (close shop v)\n    play sound [REGISTER v] until done\nelse\n    play sound [Clang v] until done\nend\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [open shop v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen this sprite clicked\nbroadcast (close shop v)\nset [close da shop now v] to [YES]\n\nwhen I receive [close shop v]\nhide\n\n@portal\n\nwhen I receive [green flag v]\ngo to [back v] layer\nshow\n\nwhen I receive [tick v]\nPostions x: ((X) - (SCROLL X)) y: ((y) - (SCROLL Y))\nif <<touching (player v)?> and <(costume [name v]) = [open]>> then\n    set [exit v] to [win]\nend\n\ndefine Postions x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [set up v]\ngo to [back v] layer\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (closed v)\nif <(level) = [1]> then\n    clone at x: [1975] y: [225]\nelse\n    if <(level) = [2]> then\n        clone at x: [2440] y: [146]\n    else\n        if <(level) = [3]> then\n            clone at x: [2216] y: [170]\n        else\n            if <(level) = [4]> then\n                clone at x: [999999999999999999999999] y: [0]\n            end\n        end\n    end\nend\n\ndefine clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\nhide\n\nwhen I receive [open door v]\nswitch costume to (open v)\n\n@lava textures\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\ndefine postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine postionx: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [tick v]\npostion ((X) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nswitch costume to (all v)\nset [y v] to [0]\nset [x v] to [0]\nif <(level) = [2]> then\n    switch costume to (all2 v)\n    postionx: [550] y: [0]\n    postionx: [650] y: [0]\n    postionx: [600] y: [0]\n    postionx: [400] y: [0]\nelse\n    if <(level) = [3]> then\n        switch costume to (level3 1 v)\n        postionx: [600] y: [0]\n        postionx: [650] y: [0]\n        postionx: [500] y: [0]\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\n@instructions\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (4))\n    else\n        change size by (((100) - (size)) / (4))\n    end\nend\n\nwhen this sprite clicked\nstart sound [Wood Tap v]\nnext costume\n\nwhen I receive [hide welcome v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [finish intro v]\npoint in direction (90)\nreset timer\nset [ghost v] effect to (0)\nswitch costume to (instructions v)\nshow\ngo to [front v] layer\ngo to x: (60) y: (5)\nforever\n    if <(costume [number v]) = [1]> then\n        point in direction ((([sin v] of ((timer) * (100)) ) * (5)) + (90))\n    end\n    if <(costume [number v]) = [1]> then\n        go to x: (60) y: (5)\n    end\n    if <(costume [number v]) = [2]> then\n        point in direction (90)\n        go to [front v] layer\n        go to x: (0) y: (0)\n    end\nend\n\n@Intro for @JTHEJET\n\nwhen flag clicked\nIntro\n\ndefine Intro\nhide\nstart sound [Intro v]\ngo to x: (0) y: (0)\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nset [i v] to [0]\nset [i2 v] to [0]\nset [sequence v] to [1]\nswitch costume to (white v)\ncreate clone of (_myself_ v)\nswitch costume to (bar v)\ngo to x: (0) y: (-150)\ncreate clone of (_myself_ v)\nrepeat (5)\n    change y by (60)\n    create clone of (_myself_ v)\n    wait (.05) seconds\nend\ngo to x: (0) y: (0)\nwait until <(Sequence) = [2]>\nswitch costume to (letter1 v)\nset [i v] to [-150]\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\n    change [i v] by (60)\n    wait (.025) seconds\nend\nset [i v] to [0]\nwait (.75) seconds\nset [sequence v] to [3]\nwait until <(Sequence) = [4]>\nrepeat (2)\n    switch costume to (filler v)\n    create clone of (_myself_ v)\n    wait (.1) seconds\n    switch costume to (filler2 v)\n    create clone of (_myself_ v)\n    wait (.1) seconds\nend\nwait (0.8) seconds\nset [sequence v] to [5]\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nwait (.02) seconds\nswitch costume to (logo2 v)\ncreate clone of (_myself_ v)\nwait (.02) seconds\nswitch costume to (logo3 v)\ncreate clone of (_myself_ v)\nwait (.02) seconds\nwait (.75) seconds\nswitch costume to (flash v)\ncreate clone of (_myself_ v)\nswitch costume to (ring v)\ncreate clone of (_myself_ v)\nset [sequence v] to [6]\nParticles\nwait (1) seconds\nset [sequence v] to [7]\nwait until <(Sequence) = [8]>\nswitch costume to (box v)\ncreate clone of (_myself_ v)\nwait until <(Sequence) = [9]>\nswitch costume to (name v)\ncreate clone of (_myself_ v)\nswitch costume to (flash v)\ncreate clone of (_myself_ v)\nwait until <(Sequence) = [12]>\nbroadcast (Intro End v)\nstop [all v]\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    go to x: (480) y: (y position)\n    set [ghost v] effect to (100)\n    repeat (20)\n        change x by (((0) - (x position)) / (5))\n        change [ghost v] effect by (-10)\n    end\n    wait (.3) seconds\n    go to x: (0) y: (y position)\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (-5)\n    end\n    set [sequence v] to [2]\n    delete this clone\nend\nif <<(costume [number v]) > [1]> and <(costume [number v]) < [8]>> then\n    show\n    go to x: (-500) y: (-500)\n    set size to (0) %\n    point in direction (45)\n    set [ghost v] effect to (100)\n    repeat until <(Sequence) = [3]>\n        change [ghost v] effect by (-7)\n        change size by (((80) - (size)) / (5))\n        change x by (((i) - (x position)) / (5))\n        change y by (((0) - (y position)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n    end\n    set [i v] to [15]\n    repeat (20)\n        change [ghost v] effect by (5)\n        change y by (i)\n        change [i v] by (-1.5)\n        turn right ((x position) / (30)) degrees\n        change size by (-1.5)\n    end\n    set [sequence v] to [4]\n    delete this clone\nend\nif <<(costume [number v]) = [8]> or <(costume [number v]) = [9]>> then\n    show\n    go to x: (-500) y: (500)\n    clear graphic effects\n    repeat (20)\n        go to x: ((x position) / (1.2)) y: ((y position) / (1.2))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nif <<(costume [number v]) > [9]> and <(costume [number v]) < [13]>> then\n    show\n    set [ghost v] effect to (100)\n    set size to (0) %\n    point in direction (45)\n    repeat until <(Sequence) = [6]>\n        change [ghost v] effect by (-10)\n        set [i v] to (((i) * (.8)) + (((65) - (size)) / (5)))\n        change size by (i)\n        set [i2 v] to (((i2) * (.7)) + (((90) - (direction)) / (5)))\n        turn right (i2) degrees\n    end\n    repeat until <(Sequence) = [7]>\n        set [i v] to (((i) * (.8)) + (((120) - (size)) / (5)))\n        change size by (i)\n        point in direction ((90) + ((3) * ([cos v] of ((timer) * (180)) )))\n        set y to ((10) * ([cos v] of (((timer) - (1)) * (200)) ))\n    end\n    if <(costume [number v]) = [10]> then\n        set [i v] to [10]\n        set [i2 v] to [13]\n        repeat (40)\n            turn right ((x position) / (40)) degrees\n            change [ghost v] effect by (3)\n            change x by (i2)\n            change y by (i)\n            change size by (-2)\n            change [i v] by (-1.5)\n            set [i2 v] to ((i2) * (.9))\n        end\n        set [sequence v] to [8]\n        delete this clone\n    else\n        if <(costume [number v]) = [11]> then\n            set [i v] to [12]\n            set [i2 v] to [5]\n            repeat (40)\n                turn right ((x position) / (40)) degrees\n                change size by (-2)\n                change [ghost v] effect by (3)\n                change x by (i2)\n                change y by (i)\n                change [i v] by (-1)\n                set [i2 v] to ((i2) * (.9))\n            end\n            delete this clone\n        else\n            set [i v] to [12]\n            set [i2 v] to [-10]\n            repeat (40)\n                turn right ((x position) / (40)) degrees\n                change size by (-2)\n                change [ghost v] effect by (3)\n                change x by (i2)\n                change y by (i)\n                change [i v] by (-1)\n                set [i2 v] to ((i2) * (.9))\n            end\n            delete this clone\n        end\n    end\nend\nif <(costume [number v]) = [13]> then\n    if <not <(Sequence) = [9]>> then\n        go to x: (0) y: (0)\n        go to [front v] layer\n        show\n        set [ghost v] effect to (0)\n        set [brightness v] effect to (-100)\n        repeat (40)\n            go to [front v] layer\n            change [ghost v] effect by (4)\n        end\n        delete this clone\n    else\n        go to x: (0) y: (0)\n        go to [front v] layer\n        show\n        set [ghost v] effect to (0)\n        set [brightness v] effect to (100)\n        repeat (40)\n            go to [front v] layer\n            change [ghost v] effect by (4)\n        end\n        delete this clone\n    end\nend\nif <(costume [number v]) = [14]> then\n    show\n    set size to (pick random (80) to (200)) %\n    set [ghost v] effect to (pick random (10) to (30))\n    set [brightness v] effect to (pick random (-20) to (20))\n    set [i v] to (pick random (-20) to (20))\n    set [i2 v] to (pick random (10) to (20))\n    repeat until <touching (_edge_ v)?>\n        change size by (-1)\n        change x by (i)\n        change y by (i2)\n        change [i2 v] by (-2)\n    end\n    delete this clone\nend\nif <<(costume [number v]) = [15]> or <(costume [number v]) = [16]>> then\n    show\n    switch costume to (ring v)\n    set size to (20) %\n    set [ghost v] effect to (80)\n    go to x: (0) y: (0)\n    point in direction (90)\n    go to [front v] layer\n    set [i v] to [5]\n    repeat (50)\n        switch costume to (ring2 v)\n        set size to (i2) %\n        change size by (i)\n        set [i2 v] to (size)\n        change [i v] by (2)\n        switch costume to (ring v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [17]> then\n    show\n    go to x: (0) y: (360)\n    set [ghost v] effect to (100)\n    repeat until <(round (y position)) = [0]>\n        change [ghost v] effect by (-10)\n        change y by (((0) - (y position)) / (6))\n    end\n    set [sequence v] to [9]\n    wait until <(Sequence) = [10]>\n    repeat until <(round (y position)) = [360]>\n        change [ghost v] effect by (5)\n        change y by (((360) - (y position)) / (6))\n    end\n    set [sequence v] to [11]\n    delete this clone\nend\nif <(costume [number v]) = [18]> then\n    show\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set size to (100) %\n    set [ghost v] effect to (0)\n    point in direction (90)\n    repeat (50)\n        change [ghost v] effect by (3)\n        change size by (-0.5)\n    end\n    set [sequence v] to [10]\n    delete this clone\nend\nif <(costume [number v]) = [19]> then\n    show\n    go to x: (0) y: (0)\n    wait until <(Sequence) = [11]>\n    broadcast (finish intro v)\n    delete this clone\nend\n\nwhen I receive [change size v]\nrepeat (7)\n    change size by (((200) - (size)) / (5))\nend\n\ndefine Particles\ngo [backward v] (5) layers\nswitch costume to (particle v)\nrepeat (10)\n    create clone of (_myself_ v)\nend\n\n@Sprite2\n\n
@InfinitelyEndless for the awesome original