The Lost Light (scrolling platformer) [outdated beta]

Instructions: Full game is out: https://scratch.mit.edu/projects/416410318/\n\nThis project is outdated. Check out the full game instead! :D\nor play some of these amazing games: ;D\n\n- Frosty Platformer by @TimMcCool\nhttps://scratch.mit.edu/projects/382847666/\n\n- Cube World by @krishtheking123\nhttps://scratch.mit.edu/projects/403477222/\n\n- Good vs Evil 2 - The Battle by @cheekyscuola\nhttps://scratch.mit.edu/projects/404746064/\n

@Stage\n\nwhen flag clicked\nforever\n    set [fps v] to (round ((1) / ((timer) - (prevtime))))\n    set [prevtime v] to (timer)\n    clear graphic effects\nend\n\nwait (0) seconds\n\n@Sprite8\n\nwhen flag clicked\nhide\n\n@ground\n\nwhen I receive [update v]\ngo to [front v] layer\ngo [backward v] (40) layers\nif <(Level) = [4]> then\n    position (((x) + (400)) - (SCROLL X)) ((y) - (SCROLL Y))\nelse\n    position (((((x) + (x+)) + (([sin v] of ((timer) * (x\[\])) ) * (x \(\)))) + (0)) - (SCROLL X)) (((y) + (([sin v] of ((timer) * (y \[\])) ) * (y \(\)))) - (SCROLL Y))\n    if <touching (box v)?> then\n        if <(Level) = [8]> then\n            if <(id) = [10]> then\n                set [impulsex v] to ((([sin v] of (((timer) + ((1) / (fps))) * (x\[\])) ) * (x \(\))) - (([sin v] of ((timer) * (x\[\])) ) * (x \(\))))\n            end\n            if <(id) = [11]> then\n                set [impulsex v] to ((([sin v] of (((timer) + ((1) / (fps))) * (x\[\])) ) * (x \(\))) - (([sin v] of ((timer) * (x\[\])) ) * (x \(\))))\n            end\n        end\n    end\nend\n\nwhen I receive [setup v]\nwait (0.1) seconds\nclear graphic effects\nhide\nset [x\[\] v] to []\nset [x \(\) v] to [0]\nset [y \[\] v] to []\nset [y \(\) v] to [0]\nif <(Level) = [1]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    set [x v] to [-900]\n    set [y v] to [-360]\n    repeat (3)\n        clone\n    end\nend\nif <(Level) = [2]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\nend\nif <(Level) = [3]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\nend\nif <(Level) = [4]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\nend\nif <(Level) = [5]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\nend\nif <(Level) = [8]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    set [x \(\) v] to [150]\n    set [x\[\] v] to [80]\n    set [x v] to [150]\n    set [y v] to [-160]\n    set [id v] to [10]\n    create clone of (_myself_ v)\n    set [x \(\) v] to [120]\n    set [x\[\] v] to [80]\n    set [x v] to [900]\n    set [y v] to [-70]\n    set [id v] to [11]\n    create clone of (_myself_ v)\nend\nif <(Level) = [6]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (4)\n        clone\n    end\nend\nif <(Level) = [9]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\nend\n\ndefine position (x) (y)\nswitch costume to (join (join (Level) [_]) (id))\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\ndefine clone\nchange [id v] by (1)\nchange [x v] by (450)\nset [x+ v] to [0]\ncreate clone of (_myself_ v)\n\nchange [level v] by (-1)\n\nwhen I receive [ded v]\nset [x+ v] to [0]\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@box\n\ndefine Physics\nset size to (60) %\ngo to [front v] layer\ngo [backward v] (20) layers\nif <(timer) > [1]> then\n    if <([abs v] of (sx) ) < [17]> then\n        if <<key (right arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of ((joystick.impulse.direction) - (90)) ) < [67]>>> then\n            change [sx v] by (4)\n        else\n            if <<key (left arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of ((joystick.impulse.direction) - (-90)) ) < [67]>>> then\n                change [sx v] by (-4)\n            end\n        end\n    end\n    if <<key (up arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of (joystick.impulse.direction) ) < [67]>>> then\n        if <(air) < [1]> then\n            set [sy v] to [17]\n            change [stats:jumps v] by (1)\n        end\n    end\n    if <(b) = [1]> then\n        broadcast (boing v)\n        set [sy v] to [25]\n        set [sj v] to [-70]\n    end\n    change [sy v] by (-1.3)\n    set [sx v] to ((sx) * (0.6))\n    if <(sy) < [-10]> then\n        set [sy v] to [-10]\n    end\n    change [x v] by (impulsex)\n    change [y v] by (impulsey)\n    set [impulsex v] to [0]\n    set [impulsey v] to [0]\n    x (sx)\n    y (sy)\nend\nset [y v] to (round (y))\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (4)))\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (8)))\nset [scroll x v] to (round (SCROLL X))\nset [scroll y v] to (round (SCROLL Y))\nScrollYMin\ngoto\nif <touching (ground3 v)?> then\n    set [win? v] to [1]\nend\nset size to (70) %\ngoto\n\nset [x v] to (round (x))\nset [y v] to (round (y))\n\ndefine y (sy)\nchange [y v] by (sy)\nchange [air v] by (1)\ngoto\nrepeat until <not <touching (ground v)?>>\n    if <([abs v] of (sy) ) = (sy)> then\n        set [sy v] to [0]\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [air v] to [0]\n        set [air v] to [0]\n        set [sy v] to [0]\n        if <[-7] > (sy)> then\n            start sound [Landing v]\n        end\n    end\n    goto\nend\n\ndefine x (sx)\nchange [x v] by (sx)\ngoto\nif <touching (ground v)?> then\n    change [air v] by (1)\n    repeat (10)\n        change [y v] by (1)\n        goto\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\n    change [x v] by ((0) - (sx))\n    goto\n    set [sx v] to [0]\n    if <<key (up arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of (joystick.impulse.direction) ) < [67]>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-35]\n        else\n            set [sx v] to [35]\n        end\n        set [sy v] to [10]\n        change [stats:walljumps v] by (1)\n        start sound [Jump v]\n    end\nend\n\ndefine goto\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nset [ghost v] effect to (0)\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (1) seconds\nset [level v] to [0]\nbroadcast (intro v) and wait\nbroadcast (start background fog v)\nset [level v] to [1]\nIntialize\nforever\n    if <(win?) = [0]> then\n        if <(die) = [0]> then\n            broadcast (update v)\n            broadcast (after-update v)\n        else\n            change [stats:deaths+restart v] by (1)\n            start sound [Crunch v]\n            set [sx v] to [-2]\n            set [sy v] to [12]\n            set [d.br v] to [120]\n            repeat (30)\n                change [d.br v] by ((d.br) / (-12))\n                set size to (60) %\n                set [brightness v] effect to (d.br)\n                change x by (sx)\n                change y by (sy)\n                change [sy v] by (-1.2)\n            end\n            clear graphic effects\n            broadcast (ded v)\n            set [sy v] to [0]\n            set [sx v] to [0]\n            set [air v] to [0]\n            set [scroll y v] to [-158]\n            ScrollYMin\n            set [scroll x v] to [-162]\n            set [x v] to [-162]\n            set [y v] to [-158]\n            set [die v] to [0]\n            set [win? v] to [0]\n            set [die v] to [0]\n            repeat (2)\n                broadcast (update v)\n                goto\n            end\n        end\n    else\n        broadcast (me.win v)\n        broadcast (win v) and wait\n    end\nend\n\nwhen I receive [after-update v]\nPhysics\n\ndefine Intialize\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [sx v] to [0]\nshow\nset [scroll y v] to [0]\nset [scroll x v] to [0]\nbroadcast (setup v) and wait\nbroadcast (update v) and wait\nbroadcast (render grass v) and wait\nset [scroll x v] to [-162]\nset [scroll y v] to [-170]\nScrollYMin\nset [x v] to [-162]\nset [y v] to [-170]\nbroadcast (update v)\nset [air v] to [10]\nset [die v] to [0]\nset [win? v] to [0]\nset volume to (100) %\nreset timer\n\nwhen I receive [next v]\nIntialize\n\nwhen flag clicked\nset volume to (0) %\nwait (2) seconds\nset volume to (100) %\nstart sound [High Hat v]\nwait (1) seconds\nset volume to (0) %\nwait (3) seconds\nforever\n    if <(die) = [0]> then\n        if <<key (right arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of ((joystick.impulse.direction) - (90)) ) < [67]>>> then\n            switch costume to (r v)\n        else\n            if <<key (left arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of ((joystick.impulse.direction) - (-90)) ) < [67]>>> then\n                switch costume to (l v)\n            else\n                if <<key (up arrow v) pressed?> or <<(joystick.on) = [1]> and <([abs v] of ((joystick.impulse.direction) - (0)) ) < [67]>>> then\n                    switch costume to (u v)\n                else\n                    if <<(pick random (1) to (30)) = [1]> and <(timer) > [3]>> then\n                        repeat (1)\n                            switch costume to (1 v)\n                        end\n                        repeat (1)\n                            switch costume to (2 v)\n                        end\n                        start sound [High Hat v]\n                        repeat (1)\n                            switch costume to (3 v)\n                        end\n                        repeat (1)\n                            switch costume to (4 v)\n                        end\n                        repeat (7)\n                            switch costume to (5 v)\n                        end\n                        repeat (1)\n                            switch costume to (4 v)\n                        end\n                        repeat (1)\n                            switch costume to (3 v)\n                        end\n                        repeat (1)\n                            switch costume to (2 v)\n                        end\n                        repeat (1)\n                            switch costume to (1 v)\n                        end\n                    else\n                        switch costume to (n v)\n                    end\n                end\n            end\n        end\n    else\n        switch costume to (7 v)\n    end\nend\n\ndefine ScrollYMin\nif <(Level) = [1]> then\n    if <(SCROLL Y) < [-70]> then\n        set [scroll y v] to [-70]\n    end\nend\nif <(Level) = [2]> then\n    if <(SCROLL Y) < [-120]> then\n        set [scroll y v] to [-120]\n    end\nend\nif <(Level) = [3]> then\n    if <(SCROLL Y) < [-170]> then\n        set [scroll y v] to [-170]\n    end\nend\nif <(Level) = [4]> then\n    if <(SCROLL Y) < [-170]> then\n        set [scroll y v] to [-170]\n    end\nend\nif <(Level) = [8]> then\n    if <(SCROLL Y) < [-210]> then\n        set [scroll y v] to [-210]\n    end\nend\nif <(Level) = [5]> then\n    if <(SCROLL Y) < [-145]> then\n        set [scroll y v] to [-145]\n    end\nend\nif <(Level) = [9]> then\n    set [scroll x v] to [-162]\nend\n\nwhen flag clicked\nset [b v] to [0]\n\nwhen I receive [boing v]\nset [b v] to [0]\nwait (0.1) seconds\nstart sound [smw_spring_jump v]\n\nwhen I receive [show bar v]\nforever\n    set volume to (([abs v] of ((mute.sound) - (1)) ) * (100)) %\nend\n\nwhen I receive [me.win v]\nif <(skipped) = [0]> then\n    start sound [Collect v]\n    repeat (10)\n        change x by (((x position) - ([x position v] of [ground3 v])) / (-6))\n        change y by (((y position) - ([y position v] of [ground3 v])) / (-6))\n        broadcast (update v)\n    end\nelse\n    set [skipped v] to [0]\nend\nset volume to (0) %\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [stoap v]\nstop [other scripts in sprite v]\n\n@pen\n\ndefine xb\nset [velocity.1 v] to ((sj) * (-0.2))\nchange [sj v] by (velocity.1)\n\ndefine Draw art\nset [u v] to [0]\nrepeat (length of [particlex v])\n    change [u v] by (1)\n    set pen color to (#ababab)\n    set pen (transparency v) to (86)\n    go to x: ((item (u) of [particlex v]) + (([sin v] of (((timer) + (item (u) of [particlesize v])) * (100)) ) * (40))) y: (item (u) of [particley v])\n    set pen size to (item (u) of [particlesize v])\n    pen down\n    set pen (transparency v) to (100)\n    pen up\n    replace item (u) of [particley v] with ((item (u) of [particley v]) + (2))\n    if <[435] < (item (u) of [particley v])> then\n        delete (u) of [particlex v]\n        delete (u) of [particley v]\n        delete (u) of [particlesize v]\n    end\nend\nif <(pick random (1) to (12)) < [2]> then\n    add (pick random (-230) to (230)) to [particlex v]\n    add [-435] to [particley v]\n    add (pick random (6) to (9)) to [particlesize v]\nend\n\nwhen I receive [update v]\nhide\nerase all\nDraw art\nplayerlight\nif <(Level) = [1]> then\n    new light at [-165] [20]\nend\nif <(Level) = [2]> then\n    new light at [-220] [0]\n    new light at [413] [-130]\n    new lava pool at [99] [-400] length [130] height [150]\n    new lava pool at [250] [-400] length [1000] height [200]\nend\nif <(Level) = [3]> then\n    new lava pool at [-600] [-500] length [450] height [200]\n    new lava pool at [-150] [-475] length [150] height [200]\n    new lava pool at [0] [-500] length [130] height [200]\n    new lava pool at [130] [-475] length [100] height [200]\n    new lava pool at [200] [-500] length [2000] height [200]\n    new light at [540] [210]\n    Draw sj at [245] [-190] (sj)\n    Draw sj at [449] [50] (sj)\n    Draw sj at [699] [279] (sj)\n    new light at [450] [-55]\nend\nif <(Level) = [4]> then\n    new light at [595] [-80]\n    new light at [400] [165]\n    new lava pool at [-600] [-500] length [3000] height [200]\nend\nif <(Level) = [5]> then\n    new light at [-805] [-30]\n    new light at [-200] [-230]\n    new lava pool at [-2000] [-500] length [4000] height [200]\nend\nif <(Level) = [8]> then\n    new light at [530] [-150]\n    new light at [-205] [-250]\n    new lava pool at [-500] [-430] length [2000] height [100]\n    Draw sj at [575] [-50] (sj)\nend\nif <(Level) = [7]> then\n    new lava pool at [-500] [-430] length [550] height [100]\n    new light at [197] [45]\n    new light at [750] [190]\n    Draw sj at [716] [-60] (sj)\n    Draw sj at [482] [460] (sj)\n    Draw sj at [767] [280] (sj)\nend\nif <(Level) = [6]> then\n    new light at [-140] [40]\n    Draw sj at [40] [-170] (sj)\nend\nif <(Level) = [9]> then\n    new lava pool at [-750] [-430] length [1500] height [100]\n    new light at [-114] [-250]\nend\n\ndefine playerlight\npen up\ngo to (box v)\nset pen color to (#ffffff)\nset pen (transparency v) to (80)\nset pen size to ((120) + (([sin v] of (((timer) + (1)) * (200)) ) * (15)))\npen down\npen up\nset pen size to ((160) + (([sin v] of (((timer) + (2)) * (200)) ) * (15)))\npen down\npen up\nset pen size to ((200) + (([sin v] of (((timer) + (3)) * (200)) ) * (15)))\npen down\npen up\n\ndefine new light at (x) (y)\nif <(Level) = [0]> then\n    pen up\n    go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n    set pen color to (#ffc26e)\n    set pen (transparency v) to (86)\n    set pen size to ((70) + (([cos v] of (((timer) + (1)) * (200)) ) * (15)))\n    pen down\n    pen up\n    set pen size to ((100) + (([cos v] of (((timer) + (2)) * (200)) ) * (15)))\n    pen down\n    pen up\n    set pen size to ((130) + (([cos v] of (((timer) + (3)) * (200)) ) * (15)))\n    pen down\n    pen up\nelse\n    pen up\n    go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n    set pen color to (#ffc26e)\n    set pen (transparency v) to (86)\n    set pen size to ((70) + (([cos v] of (((timer) + (1)) * (400)) ) * (15)))\n    pen down\n    pen up\n    set pen size to ((100) + (([cos v] of (((timer) + (2)) * (400)) ) * (15)))\n    pen down\n    pen up\n    set pen size to ((130) + (([cos v] of (((timer) + (3)) * (400)) ) * (15)))\n    pen down\n    pen up\nend\n\ndefine new lava pool at (x) (y) length (l) height (h)\nset [i v] to [0]\nrepeat ([floor v] of ((l) / (10)) )\n    if <([abs v] of (((x) + ((i) * (10))) - (SCROLL X)) ) < [270]> then\n        go to x: (((x) + ((i) * (10))) - (SCROLL X)) y: ((y) - (SCROLL Y))\n        set pen size to (10)\n        set pen color to (#7d2727)\n        pen down\n        go to x: (((x) + ((i) * (10))) - (SCROLL X)) y: (((y) + ((h) + (([sin v] of (((timer) + ((i) * (2))) * (200)) ) * (5)))) - (SCROLL Y))\n        pen up\n    end\n    change [i v] by (1)\nend\nif <(x) < ([x v] of [box v])> then\n    if <([x v] of [box v]) < ((x) + (l))> then\n        if <(y) < ([y v] of [box v])> then\n            if <([y v] of [box v]) < ((y) + ((h) + (30)))> then\n                set [die v] to [1]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [0]> then\n        erase all\n        set [scroll x v] to [0]\n        set [scroll y v] to [0]\n        new light at [0] [110]\n    end\nend\n\ndefine Draw sj at (x) (y) (h)\nif <([abs v] of (((x) - ()) - (SCROLL X)) ) < [270]> then\n    pen up\n    set pen color to (#b7b7b7)\n    set pen size to (4)\n    set pen (transparency v) to (50)\n    set [i v] to [4]\n    go to x: (((x) - (-15)) - (SCROLL X)) y: ((((y) - (h)) + ((((50) + (h)) / (-4)) * (i))) - (SCROLL Y))\n    repeat (4)\n        change [i v] by (-1)\n        if <([floor v] of ((i) / (2)) ) = ((i) / (2))> then\n            go to x: (((x) - (-15)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (15)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        end\n        pen down\n        set pen color to (#ffffff)\n        set pen size to (4)\n        set pen (transparency v) to (50)\n    end\n    pen up\n    set [i v] to [4]\n    go to x: (((x) - (15)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n    pen down\n    set pen color to (#ffffff)\n    set pen size to (4)\n    set pen (transparency v) to (50)\n    repeat (4)\n        change [i v] by (-1)\n        if <([floor v] of ((i) / (2)) ) = ((i) / (2))> then\n            go to x: (((x) - (15)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (-15)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        end\n    end\n    pen up\n    if <<((x) - (30)) < ([x v] of [box v])> and <([x v] of [box v]) < ((x) - (-30))>> then\n        if <<((y) - (50)) < ([y v] of [box v])> and <([y v] of [box v]) < (((y) + (h)) - (0))>> then\n            set [b v] to [1]\n        end\n    end\n    go to x: (((x) - (18)) - (SCROLL X)) y: (((y) + (h)) - (SCROLL Y))\n    set pen size to (10)\n    set pen color to (#c3c3c3)\n    pen down\n    go to x: (((x) - (-19)) - (SCROLL X)) y: (((y) + (h)) - (SCROLL Y))\n    pen up\nend\n\nwhen flag clicked\nforever\n\nwhen flag clicked\nforever\n    xb\nend\n\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Fog\n\nwhen I start as a clone\nset x to (554)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-2)\n    go to [back v] layer\n    go [forward v] (9) layers\n    change x by (-1)\n    if <(x position) = [0]> then\n        create clone of (_myself_ v)\n    end\n    if <(x position) = [-554]> then\n        delete this clone\n    end\nend\nforever\n    set [ghost v] effect to (80)\n    go to [back v] layer\n    go [forward v] (9) layers\n    change x by (-1)\n    if <(x position) = [0]> then\n        create clone of (_myself_ v)\n    end\n    if <(x position) = [-554]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\n\nwhen I receive [start background fog v]\nset [ghost v] effect to (80)\ngo to x: (0) y: (0)\nshow\ncreate clone of (_myself_ v)\nforever\n    change x by (-1)\n    if <(x position) = [-554]> then\n        hide\n    end\n    go to [back v] layer\nend\n\nwhen flag clicked\nhide\n\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@ground2\n\nwhen I receive [update v]\nset [ghost v] effect to (1)\ngo to [front v] layer\ngo [backward v] ((id) + (30)) layers\nif <(Level) = [4]> then\n    position (((x) + (400)) - (SCROLL X)) ((y) - (SCROLL Y))\nelse\n    position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen I receive [setup v]\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [1]> then\n    set [x v] to [-450]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (2)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [2]> then\n    set [x v] to [-450]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (2)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [3]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [4]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [5]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [8]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [7]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [6]> then\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\nif <(Level) = [9]> then\n    broadcast (hide bar v)\n    set [x v] to [-900]\n    set [y v] to [0]\n    set [id v] to [0]\n    repeat (3)\n        clone\n    end\n    change [id v] by (1)\n    change [x v] by (10000000000000000000000)\n    set [y v] to [0]\nend\n\ndefine position (x) (y)\nswitch costume to (join (join (Level) [_]) (id))\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 [setup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine clone\nchange [id v] by (1)\nchange [x v] by (450)\nset [y v] to [0]\ncreate clone of (_myself_ v)\n\ndelete this clone\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@ground3\n\nwhen I receive [update v]\nposition ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + (([sin v] of ((timer) * (200)) ) * (20)))\n\nwhen I receive [setup v]\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [1]> then\n    new portal @ [281] [0]\nend\nif <(Level) = [2]> then\n    new portal @ [730] [-30]\nend\nif <(Level) = [3]> then\n    new portal @ [953] [360]\nend\nif <(Level) = [4]> then\n    new portal @ [1135] [360]\nend\nif <(Level) = [5]> then\n    new portal @ [1000] [-50]\nend\nif <(Level) = [8]> then\n    new portal @ [800] [-100]\nend\nif <(Level) = [7]> then\n    new portal @ [762] [500]\nend\nif <(Level) = [6]> then\n    new portal @ [1090] [68]\nend\nif <(Level) = [9]> then\n    new portal @ [100000000000000000000] [40]\nend\n\ndefine position (x) (y)\nswitch costume to (portal v)\nif <(id) = [1]> then\n    set [ghost v] effect to ((60) + (([cos v] of ((timer) * (300)) ) * (20)))\nelse\n    set [ghost v] effect to ((60) + (([sin v] of ((timer) * (300)) ) * (20)))\nend\ngo to x: (x) y: (y)\nturn right ((3) * (id)) degrees\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine new portal @ (x) (y)\npoint in direction (90)\nset [x v] to (x)\nset [y v] to (y)\nset [id v] to [-1]\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nset [id v] to [1]\nset [portal-x v] to (x)\nset [portal-y v] to (y)\n\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@effect_3\n\ndefine dd\nset [ghost v] effect to (90)\ngo to [back v] layer\nforever\n    go to [back v] layer\n    turn right (3) degrees\nend\n\nwhen I start as a clone\ndd\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset size to (100) %\npoint in direction (45)\ncreate clone of (_myself_ v)\npoint in direction (0)\ncreate clone of (_myself_ v)\npoint in direction (-45)\ncreate clone of (_myself_ v)\npoint in direction (-90)\ncreate clone of (_myself_ v)\npoint in direction (-135)\ncreate clone of (_myself_ v)\npoint in direction (180)\ncreate clone of (_myself_ v)\npoint in direction (90)\ncreate clone of (_myself_ v)\npoint in direction (135)\ndd\n\nwhen I receive [update v]\nif <(die) = [1]> then\n    hide\nelse\n    show\nend\ngo to x: ((portal-x) - (SCROLL X)) y: (((portal-y) - (SCROLL Y)) + (([sin v] of ((timer) * (200)) ) * (20)))\nswitch costume to (1 v)\n\n\n\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite1\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nclear graphic effects\nforever\n    go to [front v] layer\nend\n\nwhen I receive [after-update v]\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nchange [ghost v] effect by (1)\n\nwhen I receive [win v]\nclear graphic effects\nswitch costume to (costume1 v)\npoint in direction (180)\ngo to x: (226) y: (-180)\nrepeat (35)\n    broadcast (update v)\n    turn right (((direction) - (90)) / (-6)) degrees\nend\nif <(Level) = [6]> then\n    change [level v] by (2)\nelse\n    change [level v] by (1)\nend\nbroadcast (next v) and wait\n\nturn right (15) degrees\n\nwhen I receive [intro v]\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\nwhen I receive [setup v]\ndelete this clone\n\n@Fog2\n\nwhen I start as a clone\nset x to (651)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [color v] effect by (-2)\n    go to [back v] layer\n    go [forward v] (0) layers\n    change x by (-3)\n    if <(x position) = [0]> then\n        create clone of (_myself_ v)\n    end\n    if <(x position) = [-588]> then\n        delete this clone\n    end\nend\nforever\n    set [ghost v] effect to (80)\n    go to [back v] layer\n    go [forward v] (0) layers\n    change x by (-3)\n    if <(x position) = [0]> then\n        create clone of (_myself_ v)\n    end\n    if <(x position) = [-588]> then\n        delete this clone\n    end\nend\n\nwhen I receive [start background fog v]\nset [ghost v] effect to (80)\ngo to x: (0) y: (0)\nshow\ncreate clone of (_myself_ v)\nforever\n    go to [back v] layer\n    change x by (-3)\n    if <(x position) = [-588]> then\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@bar\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I receive [show bar v]\nshow\ndelete all of [buttons.touching? v]\nswitch costume to (kostüm1 v)\ngo to x: (0) y: (100)\nnew button @ [-215] [161] [1]\nnew button @ [-185] [161] [2]\nnew button @ [185] [161] [3]\nnew button @ [215] [161] [4]\nnew button @ [-120] [161] [5]\nnew button @ [] [] [10]\n\ndefine new button @ (x) (y) (type)\nadd [0] to [buttons.touching? v]\nset [x v] to (x)\nset [y v] to (y)\nset [mode v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [mute v] to [0]\nhide\ngo to [front v] layer\nset [ghost v] effect to (10)\nif <(mode) < [6]> then\n    go to [front v] layer\n    if <(mode) = [1]> then\n        switch costume to (2_ v)\n    end\n    if <(mode) = [2]> then\n        switch costume to (3_ v)\n    end\n    if <(mode) = [3]> then\n        switch costume to (5_ v)\n    end\n    if <(mode) = [4]> then\n        switch costume to (6_ v)\n    end\n    if <(mode) = [5]> then\n        switch costume to (15 v)\n    end\n    go to x: (x) y: (y)\n    show\n    forever\n        repeat until <touching (mouse-pointer v)?>\n            change size by (((size) - (85)) / (-5))\n            replace item (mode) of [buttons.touching? v] with [0]\n            set [brightness v] effect to (-50)\n            xb\n            if <(mode) = [1]> then\n                if <(mute) = [1]> then\n                    switch costume to (1_ v)\n                else\n                    switch costume to (2_ v)\n                end\n            end\n            if <(mode) = [2]> then\n                if <(mute.sound) = [0]> then\n                    switch costume to (4_ v)\n                else\n                    switch costume to (3_ v)\n                end\n            end\n        end\n        if <(win?) = [0]> then\n            if <(mute.sound) = [0]> then\n                start sound [Touch v]\n            end\n        end\n        repeat until <not <touching (mouse-pointer v)?>>\n            if <mouse down?> then\n                if <<(win?) = [0]> and <[2] < (timer)>> then\n                    if <(mode) = [1]> then\n                        if <(mute) = [0]> then\n                            repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                                set y to (pick random ((y) + (5)) to (y))\n                            end\n                            if <touching (mouse-pointer v)?> then\n                                set [mute v] to [1]\n                                switch costume to (12 v)\n                            end\n                        else\n                            repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                                set y to (pick random ((y) + (5)) to (y))\n                            end\n                            if <touching (mouse-pointer v)?> then\n                                set [mute v] to [0]\n                            end\n                        end\n                    end\n                    if <(mode) = [2]> then\n                        if <(mute.sound) = [0]> then\n                            repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                                set y to (pick random ((y) + (5)) to (y))\n                            end\n                            if <touching (mouse-pointer v)?> then\n                                set [mute.sound v] to [1]\n                            end\n                        else\n                            repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                                set y to (pick random ((y) + (5)) to (y))\n                            end\n                            if <touching (mouse-pointer v)?> then\n                                set [mute.sound v] to [0]\n                            end\n                        end\n                    end\n                    if <(mode) = [3]> then\n                        repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                            set y to (pick random ((y) + (5)) to (y))\n                        end\n                        if <touching (mouse-pointer v)?> then\n                            set [skipped v] to [1]\n                            set [win? v] to [1]\n                            change [stats:skips v] by (1)\n                        end\n                    end\n                    if <(mode) = [4]> then\n                        repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                            set y to (pick random ((y) + (5)) to (y))\n                        end\n                        if <touching (mouse-pointer v)?> then\n                            set [die v] to [1]\n                            change [stats:restart v] by (1)\n                        end\n                    end\n                    if <(mode) = [5]> then\n                        repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                            set y to (pick random ((y) + (5)) to (y))\n                        end\n                        if <(shop) > [0]> then\n                            set [shop v] to [0]\n                        else\n                            set [shop v] to ((fps) * (2))\n                        end\n                    end\n                end\n            end\n            xb\n            if <not <(mode) = [5]>> then\n                replace item (mode) of [buttons.touching? v] with [1]\n            end\n            set [brightness v] effect to (40)\n            change size by (((size) - (100)) / (-5))\n            if <(mode) = [2]> then\n                if <(mute.sound) = [0]> then\n                    switch costume to (4_ v)\n                else\n                    switch costume to (3_ v)\n                end\n            end\n            if <(mode) = [1]> then\n                if <(mute) = [1]> then\n                    switch costume to (1_ v)\n                else\n                    switch costume to (2_ v)\n                end\n            end\n        end\n    end\nelse\n    if <(mode) = [10]> then\n        switch costume to (skip v)\n        forever\n            set size to (65) %\n            go to x: (mouse x) y: ((mouse y) - (20))\n            show\n            set [brightness v] effect to (-30)\n            if <[buttons.touching? v] contains [1]?> then\n                set [ghost v] effect to (20)\n                if <(item (1) of [buttons.touching? v]) = [1]> then\n                    if <(mute) = [0]> then\n                        switch costume to (mute v)\n                    else\n                        switch costume to (mute2 v)\n                    end\n                else\n                    if <(item (2) of [buttons.touching? v]) = [1]> then\n                        if <(mute.sound) = [0]> then\n                            switch costume to (pause v)\n                        else\n                            switch costume to (continue v)\n                        end\n                    else\n                        if <(item (3) of [buttons.touching? v]) = [1]> then\n                            switch costume to (skip v)\n                        else\n                            if <(item (4) of [buttons.touching? v]) = [1]> then\n                                switch costume to (restart v)\n                            end\n                        end\n                    end\n                end\n            else\n                set [ghost v] effect to (100)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [mute.sound v] to [0]\n\nwhen I receive [show bar v]\nset [pitch v] effect to (0)\n\ndefine new counter @ (x) (y)\nset [x v] to (x)\nset [y v] to (y)\nset [mode v] to [6]\ncreate clone of (_myself_ v)\nrepeat (4)\n    change [mode v] by (1)\n    set [x v] to ((x) + (((mode) - (6)) * (15)))\n    set [y v] to (y)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\n\nwhen I start as a clone\nif <(mode) > [10]> then\n    forever\n        set [ghost v] effect to (30)\n        show\n        go to [front v] layer\n        switch costume to (11 v)\n        switch costume to (letter ((mode) - ((5) + ((5) - (length of (round (timer)))))) of (round (timer)))\n        go to x: (x) y: (y)\n        set [brightness v] effect to (([sin v] of (((timer) + (((mode) / (3)) - (5))) * (200)) ) * (20))\n        set size to ((([sin v] of (((timer) + (((mode) / (3)) - (5))) * (200)) ) * (10)) + (100)) %\n        if <(size) < [100]> then\n            set size to (100) %\n        end\n    end\nend\n\nwhen I receive [show bar v]\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\n    xb\n    if <(menu.of) = [0]> then\n        switch costume to (kostüm2 v)\n        set [ghost v] effect to (80)\n    else\n        switch costume to (kostüm3 v)\n        set [ghost v] effect to (60)\n    end\nend\n\nwhen flag clicked\nreset timer\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\nend\n\ndefine xb\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [1]>> then\n    if <touching (mouse-pointer v)?> then\n        set [menu.of v] to [0]\n    else\n        if <(mouse y) < [120]> then\n            set [menu.of v] to [1]\n        end\n    end\nend\nset [velocity v] to (((velocity) * (0.6)) + (((y position) - ((y) + (<(menu.of) = [1]> * (45)))) * (-0.3)))\nchange y by ([floor v] of (velocity) )\n\nwhen flag clicked\nforever\n    play sound [Dark Cave Music - Trickster Imps v] until done\nend\n\nwhen flag clicked\nforever\n    if <(mute) = [1]> then\n        set volume to (0) %\n    else\n        set volume to (100) %\n    end\nend\n\nwhen I receive [hide bar v]\nhide\ndelete this clone\n\n@grass\n\ndefine Grass from (xpos1) to (xpos2) at this y area (+-180) (yarea)\nswitch costume to (base hitbox v)\nset [scroll y v] to (yarea)\nshow\nset [scroll x v] to ((xpos1) + (180))\ngo to x: (-180) y: (0)\npoint in direction (90)\nset [ghost v] effect to (100)\nbroadcast (update v)\nrepeat until <((SCROLL X) + (x position)) > (xpos2)>\n    if <(pick random (1) to (2)) = [2]> then\n        change x by (1.5)\n    else\n        change x by (11.5)\n    end\n    set size to (125) %\n    set [x v] to ((SCROLL X) + (x position))\n    set [yarea v] to ((yarea) + (pick random (1) to (-1)))\n    create clone of (_myself_ v)\nend\n\nchange [scroll x v] by (1.5)\n\nchange [scroll x v] by (11.5)\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nGrass\n\ndefine Grass\nswitch costume to (base hitbox v)\ngo to x: ((x) - (SCROLL X)) y: (0)\nif <touching (ground v)?> then\n    repeat until <<not <touching (ground v)?>> or <touching (_edge_ v)?>>\n        change y by (1)\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    change x by (-4)\n    change [x v] by (-4)\nelse\n    repeat until <touching (ground v)?>\n        change y by (-2)\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\nend\nset [y v] to ((y position) + ((yarea) - (20)))\nswitch costume to (pick random (1) to (7))\n\ndefine Sway\nif <touching (box v)?> then\n    if <(in) = [0]> then\n        set [magnitude v] to (((Magnitude) + (pick random (-2.0) to (2.0))) * (30))\n        set [sway v] to [0]\n        set [in v] to [1]\n    end\nend\nif <(in) = [1]> then\n    point in direction ((90) - (([sin v] of (sway) ) * (Magnitude)))\n    change [sway v] by (-10)\n    set [magnitude v] to ((0.95) * (Magnitude))\nend\nif <<[0] = (round (Magnitude))> or <<touching (box v)?> and <([abs v] of (Magnitude) ) < ([abs v] of ((xmotion) * (2)) )>>> then\n    set [in v] to [0]\nend\n\nwhen I receive [render grass v]\nif <(Level) = [1]> then\n    Grass from [-195] to [140] at this y area (+-180) [-153]\nend\nif <(Level) = [2]> then\n    Grass from [-190] to [70] at this y area (+-180) [-153]\nend\nif <(Level) = [3]> then\n    Grass from [758] to [815] at this y area (+-180) [300]\n    Grass from [525] to [567] at this y area (+-180) [300]\nend\nif <(Level) = [4]> then\n    Grass from [451] to [525] at this y area (+-180) [-157]\nend\nif <(Level) = [5]> then\n    Grass from [-162] to [-18] at this y area (+-180) [-157]\nend\nif <(Level) = [8]> then\n    Grass from [725] to [970] at this y area (+-180) [51]\n    wait (0.5) seconds\n    Grass from [1118] to [1142] at this y area (+-180) [-99]\n    wait (0.5) seconds\n    Grass from [-188] to [-110] at this y area (+-180) [-171]\n    wait (0.5) seconds\n    Grass from [365] to [430] at this y area (+-180) [-171]\nend\nif <(Level) = [7]> then\n    Grass from [-172] to [-122] at this y area (+-180) [-171]\nend\nif <(Level) = [6]> then\n    Grass from [110] to [352] at this y area (+-180) [0]\n    wait (0.5) seconds\n    Grass from [-218] to [0] at this y area (+-180) [-185]\n    wait (0.5) seconds\n    Grass from [750] to [1040] at this y area (+-180) [0]\nend\nif <(Level) = [9]> then\n    Grass from [-172] to [-122] at this y area (+-180) [-171]\n    wait (0.5) seconds\n    Grass from [400] to [684] at this y area (+-180) [-166]\nend\n\nwhen I receive [update v]\ngo to [front v] layer\ngo [backward v] (25) layers\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nif <<(x position) = ((x) - (SCROLL X))> and <(y position) = ((y) - (SCROLL Y))>> then\n    show\n    Sway\nelse\n    hide\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite2\n\ndefine xb\nset [vel2 v] to (((vel2) * (0.7)) + (((x position) - (0)) * (-0.3)))\nchange x by ([floor v] of (vel2) )\n\nwhen flag clicked\nswitch costume to (unbenannte zeichnung \(1\) v)\nhide\nset [id v] to [0]\ncreate clone of (_myself_ v)\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\nswitch costume to (costume2 v)\nset [ghost v] effect to (30)\n\nwhen I receive [intro v]\nif <not <(id) = [0]>> then\n    set [win? v] to [1]\n    erase all\n    wait (0.5) seconds\n    show\n    wait (2) seconds\n    wait (2) seconds\n    repeat (2)\n        wait (2) seconds\n        set [win? v] to [0]\n        reset timer\n        hide\n    end\nend\n\nwhen I receive [intro v]\nwait (7) seconds\nbroadcast (show bar v)\n\nwhen I start as a clone\nif <(id) = [1]> then\n    switch costume to (costume3 v)\n    set [ghost v] effect to (0)\n    show\nend\nif <(id) = [0]> then\n    switch costume to (unbenannte zeichnung \(1\) v)\n    set [ghost v] effect to (20)\n    show\nend\n\nwhen I receive [start background fog v]\nhide\ndelete this clone\n\nwhen I receive [intro v]\nwait (1) seconds\ngo to x: (-150) y: (0)\nrepeat (100)\n    xb\nend\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@starparticles\n\nwhen I start as a clone\nshow\neff (pick random (-10) to (10))\n\ndefine eff (x)\nset [-1 v] to [1]\nset [color v] effect to (0)\nset [ghost v] effect to (85)\nforever\n    go to [front v] layer\n    turn right (15) degrees\n    change x by ((x) * (-1))\n    set x to ((x position) + ())\n    change y by (y)\n    change [y v] by (-2)\n    if <touching (_edge_ v)?> then\n        if <(-1) = [1]> then\n            set [-1 v] to [-1]\n        else\n            set [-1 v] to [1]\n        end\n    end\n    if <(y position) < [-170]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset size to (80) %\ngo to x: (0) y: (-180)\nhide\n\ndefine clone (rand1) (rand2)\nrepeat (20)\n    set [y v] to (pick random (rand1) to (rand2))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [intro v]\npoint in direction (pick random (0) to (180))\nset size to (70) %\nset [ghost v] effect to (50)\nwait (1.5) seconds\ngo to x: (pick random (-240) to (240)) y: (-180)\nclone [20] [35]\nwait (1) seconds\ngo to x: (pick random (-240) to (240)) y: (-180)\nclone [20] [35]\n\nwhen I receive [coinget v]\ngo to x: (coin-x) y: (coin-y)\nclone [8] [15]\nwait (1) seconds\nset [itemget v] to ((1.1) * (fps))\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite3\n\nwhen I receive [update v]\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\npoint in direction ((([sin v] of ((timer) * (200)) ) * (10)) + (90))\ngo to [front v] layer\ngo [backward v] (12) layers\nif <<(x position) = ((x) - (SCROLL X))> and <(y position) = ((y) - (SCROLL Y))>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\nshow\nif <(Level) = [1]> then\n    set [x v] to [192]\n    set [y v] to [80]\nelse\n    if <(Level) = [8]> then\n        set [x v] to [874]\n        set [y v] to [-30]\n        create clone of (_myself_ v)\n        set [x v] to [955]\n        set [y v] to [-40]\n    else\n        if <(Level) = [7]> then\n            set [x v] to [317]\n            set [y v] to [100]\n        else\n            if <(Level) = [9]> then\n                set [x v] to [-180]\n                set [y v] to [-230]\n            else\n                if <(Level) = [6]> then\n                    set [x v] to [260]\n                    set [y v] to [200]\n                else\n                    set [x v] to [100000000000000000]\n                    set [y v] to [100]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Unbenannte Zeichnung (2)\n\nwhen flag clicked\ndelete all of [achievements v]\nset [skipped v] to [0]\nset [stats: coins v] to [0]\nset [stats:jumps v] to [0]\nset [stats:deaths+restart v] to [0]\nset [stats:restart v] to [0]\nset [stats:walljumps v] to [0]\nset [last v] to [0]\nset [stats: diamonds v] to [0]\nset [stats:skips v] to [0]\nrepeat (9)\n    add [0] to [achievements v]\nend\nforever\n    change [shop v] by (-1)\n    change [last v] by (-1)\n    show\n    set [ghost v] effect to (40)\n    if <(shop) < [0]> then\n        if <(itemget) < [0]> then\n            if <(last) < [0]> then\n                xb [0]\n            else\n                xb [1]\n            end\n            if <(Level) > [3]> then\n                if <(timer) > [12]> then\n                    if <(item (7) of [achievements v]) = [0]> then\n                        replace item (7) of [achievements v] with [1]\n                        switch costume to (7 v)\n                        set [last v] to [120]\n                        go to x: (0) y: (-200)\n                    end\n                end\n            end\n            if <(stats:jumps) > [4]> then\n                if <(item (1) of [achievements v]) = [0]> then\n                    replace item (1) of [achievements v] with [1]\n                    switch costume to (1 v)\n                    set [last v] to [120]\n                    go to x: (0) y: (-200)\n                end\n            end\n            if <((stats:deaths+restart) - (stats:restart)) > [2]> then\n                if <(item (2) of [achievements v]) = [0]> then\n                    replace item (2) of [achievements v] with [1]\n                    switch costume to (2 v)\n                    set [last v] to [120]\n                    go to x: (0) y: (-200)\n                end\n            end\n            if <(stats:jumps) > [24]> then\n                if <(item (3) of [achievements v]) = [0]> then\n                    replace item (3) of [achievements v] with [1]\n                    switch costume to (3 v)\n                    set [last v] to [120]\n                    go to x: (0) y: (-200)\n                end\n            end\n            if <(stats:walljumps) > [10]> then\n                if <(item (5) of [achievements v]) = [0]> then\n                    replace item (5) of [achievements v] with [1]\n                    switch costume to (5 v)\n                    set [last v] to [120]\n                    go to x: (0) y: (-200)\n                end\n            end\n            if <(stats:restart) > [0]> then\n                if <(item (4) of [achievements v]) = [0]> then\n                    replace item (4) of [achievements v] with [1]\n                    switch costume to (4 v)\n                    set [last v] to [120]\n                    go to x: (0) y: (-200)\n                end\n            end\n            go to [front v] layer\n        else\n            set [last v] to [-1]\n            go to x: (0) y: (-200)\n            set [ghost v] effect to (60)\n            switch costume to (itemget v)\n            go to [front v] layer\n            go [backward v] (4) layers\n            xb [1]\n        end\n    else\n        set [last v] to [-1]\n        go to x: (0) y: (-200)\n        set [ghost v] effect to (50)\n        switch costume to (itemget v)\n        go to [front v] layer\n        go [backward v] (4) layers\n        xb [2]\n    end\nend\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.6)) + (((y position) - (-55)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-150)) * (-0.3)))\n    else\n        set [vel v] to (((y position) - (-220)) * (-0.3))\n    end\nend\nchange y by (vel)\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@ground4\n\nwhen I receive [update v]\nposition (((x) + (([cos v] of ((timer) * (x\[\])) ) * (x\(\)))) - (SCROLL X)) ((((y) + (y+)) - (SCROLL Y)) + (([cos v] of ((timer) * (y\(\))) ) * (y\[\])))\nset size to (100) %\n\nwhen I receive [setup v]\nset [mode v] to []\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [3]> then\n    new saw @ [740] [520] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [660] [520] sinus y [] [] id [] sinus x [] [] y+ []\nend\nif <(Level) = [5]> then\n    new saw @ [58] [-175] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [233] [-130] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [515] [-130] sinus y [100] [100] id [] sinus x [] [] y+ []\n    new saw @ [715] [-130] sinus y [100] [100] id [] sinus x [] [] y+ []\nend\nif <(Level) = [8]> then\n    new saw @ [1018] [25] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [658] [25] sinus y [] [] id [] sinus x [] [] y+ []\nend\nif <(Level) = [7]> then\n    new saw @ [369] [80] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [595] [80] sinus y [] [] id [] sinus x [] [] y+ []\n    new saw @ [492] [-100] sinus y [] [] id [] sinus x [100] [100] y+ []\nend\nif <(Level) = [6]> then\n    new saw @ [419] [2] sinus y [] [] id [1] sinus x [] [] y+ [20]\n    new saw @ [551] [2] sinus y [] [] id [1] sinus x [] [] y+ [50]\n    new saw @ [684] [2] sinus y [] [] id [1] sinus x [] [] y+ [80]\nend\nset [x v] to [10000]\nset [x v] to [10000]\n\ndefine position (x) (y)\ngo to [front v] layer\ngo [backward v] (80) layers\nswitch costume to (saw v)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    if <touching (box v)?> then\n        set [die v] to [1]\n    end\nelse\n    hide\nend\nif <<(x\[\]) = []> and <(y\(\)) = []>> then\n    if <(id) = [1]> then\n        point in direction (90)\n        switch costume to (saw2 v)\n        set size to (140) %\n        if <(mode) = [0]> then\n            change [y+ v] by (3)\n            if <(y+) > [200]> then\n                set [mode v] to [1]\n            end\n        end\n        if <(mode) = [1]> then\n            change [y+ v] by (-23)\n            if <[0] > (y+)> then\n                set [mode v] to [0]\n                if <(mute.sound) = [0]> then\n                    start sound [Boom Cloud v]\n                end\n            end\n        end\n    else\n        point in direction (([cos v] of ((timer) * (120)) ) * (150))\n    end\nelse\n    turn right (3) degrees\nend\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine new saw @ (x) (y) sinus y (\(\)) (\[\]) id (i) sinus x (sinx\(\)) (sinx\[\]) y+ (y+)\npoint in direction (90)\nset [x v] to (x)\nset [y v] to (y)\nset [x\(\) v] to (sinx\(\))\nset [x\[\] v] to (sinx\[\])\nset [y\(\) v] to (\(\))\nset [y\[\] v] to (\[\])\nset [id v] to (i)\nset [mode v] to [0]\nset [y+ v] to (y+)\ncreate clone of (_myself_ v)\n\nset [level v] to [5]\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@ground5\n\nwhen I receive [update v]\nposition ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + (([cos v] of ((timer) * (y\(\))) ) * (y\[\])))\n\nwhen I receive [setup v]\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [3]> then\n    new item @ [300] [300] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [900] [-200] sinus x [] [] sinus y [200] [20] [5] type [2]\nend\nif <(Level) = [4]> then\n    new item @ [326] [246] sinus x [] [] sinus y [200] [20] [2] type [1]\nend\nif <(Level) = [5]> then\n    new item @ [712] [-200] sinus x [] [] sinus y [200] [20] [3] type [1]\n    new item @ [-714] [-100] sinus x [] [] sinus y [200] [20] [4] type [2]\nend\nif <(Level) = [8]> then\n    new item @ [400] [100] sinus x [] [] sinus y [200] [20] [7] type [1]\nend\nif <(Level) = [6]> then\n    new item @ [-220] [-90] sinus x [] [] sinus y [200] [20] [6] type [1]\nend\nset [x v] to [10000]\n\ndefine position (x) (y)\nclear graphic effects\nset [ghost v] effect to (0)\nif <(type) = [1]> then\n    next costume\n    if <(costume [name v]) = [diamond]> then\n        switch costume to (coin v)\n    end\nelse\n    switch costume to (diamond v)\n    point in direction ((([sin v] of ((timer) * (200)) ) * (10)) + (90))\n    set [brightness v] effect to (20)\nend\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <(item (id) of [coin v]) = [1]> then\n    delete this clone\nend\nif <touching (box v)?> then\n    if <(type) = [1]> then\n        change [stats: coins v] by (1)\n    else\n        change [stats: diamonds v] by (1)\n    end\n    set [get v] to [1]\n    replace item (id) of [coin v] with [1]\n    if <(mute.sound) = [0]> then\n        start sound [Coin v]\n    end\n    set [coin-x v] to (x position)\n    set [coin-y v] to (y position)\n    broadcast (coinget v)\nend\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine new item @ (x) (y) sinus x (\(\)) (\[\]) sinus y (\(\)) (\[\]) (id) type (t)\npoint in direction (90)\nset [x v] to (x)\nset [y v] to (y)\nset [x\(\) v] to (\(\))\nset [x\[\] v] to (\[\])\nset [y\(\) v] to (\(\))\nset [y\[\] v] to (\[\])\nset [id v] to (id)\nset [get v] to [0]\nset [b v] to [0]\nset [type v] to (t)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\ndelete all of [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\nadd [0] to [coin v]\n\nwhen flag clicked\nforever\n    change [itemget v] by (-1)\nend\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite4\n\n@Sprite5\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    go [backward v] (1) layers\n    switch costume to (join [.] (stats: coins))\n    set x to (-60)\n    if <(itemget) < [0]> then\n        if <(shop) < [0]> then\n            xb [0]\n        else\n            xb [2]\n        end\n    else\n        xb [1]\n    end\nend\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.2)) + (((y position) - (-80)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-155)) * (-0.3)))\n    else\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-200)) * (-0.3)))\n    end\nend\nchange y by (vel)\n\n@Sprite6\n\nwhen flag clicked\nforever\n    set x to (10)\n    switch costume to (join [.] (stats: diamonds))\n    show\n    go to [front v] layer\n    if <(itemget) < [0]> then\n        if <(shop) < [0]> then\n            xb [0]\n        else\n            xb [2]\n        end\n    else\n        xb [1]\n    end\nend\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.2)) + (((y position) - (-80)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-155)) * (-0.3)))\n    else\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-200)) * (-0.3)))\n    end\nend\nchange y by (vel)\n\n@Sprite7\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.2)) + (((y position) - (-80)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((y position) - (-140)) * (-0.3))\n    else\n        set [vel v] to (((y position) - (-240)) * (-0.3))\n    end\nend\nchange y by (vel)\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (20)\n    set x to (25)\n    show\n    go to [front v] layer\n    go [backward v] (0) layers\n    set size to (75) %\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\nend\n\n@//📊 Scratch Analytics by @TimMcCool2\n\ndefine Send Data (payload)\nset [☁ to_host v] to (payload)\n\ndefine Encode (input)\nset [//output v] to []\nset [i v] to [0]\nrepeat (length of (input))\n    change [i v] by (1)\n    switch costume to (join [=] (letter (i) of (input)))\n    set [//output v] to (join (//output) (costume [number v]))\nend\n\nwhen flag clicked\nwait (0.6) seconds\nEncode (join (username) (join [,] (join (current [hour v]) (join [,] []))))\nSend Data (//output)\n\n