The Lost Light (scrolling platformer) ✦ TimMcCool games

Instructions: arrow keys to move\nHOVER OVER "MENU" AND CLICK ON "SHOP" to open the shop\nHOVER OVER "MENU" and click on the button with an arrow to SKIP a level\navoid saws, lasers, lava and other things that look nasty\nsometimes you need a key to open a door\nthere are 12 levels\nthere are 30 coins and 8 diamonds, that's enough to buy all items from the shop\nthere's a diamond in level 3, 4, 5, 7, 8, 9, 10, 12\n\nthis game will probably cause lag on slower computers\nplug in your computer to reduce lag\nthere are 5 coins and 2 diamonds in total

@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@b l a n k\n\n@ground\n\nwhen I receive [update v]\ngo to [front v] layer\ngo [backward v] (22) 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) > [7]> 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\n    switch costume to (hack v)\n    set size to (100) %\n    switch costume to (join (join (Level) [_]) (id))\n    next costume\n    if <touching (box v)?> then\n        if <(id) = [20]> then\n            if <(key.unlock) = [1]> then\n                set [key.unlock v] to [0]\n            end\n        end\n    end\n    switch costume to (hack v)\n    set size to (100) %\n    switch costume to (join (join (Level) [_]) (id))\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) = [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\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\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 [-150]\n    set [x\[\] v] to [80]\n    set [x v] to [600]\n    set [y v] to [-160]\n    set [id v] to [11]\n    create clone of (_myself_ v)\nend\nif <(Level) = [10]> 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 [id v] to [20]\n    set [x v] to [462]\n    set [y v] to [-280]\n    create clone of (_myself_ v)\n    set [x v] to [100000000000000000000]\n    set [y v] to [0]\n    set [id v] to [0]\n    set [id v] to [3]\nend\nif <(Level) = [11]> 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 [id v] to [20]\n    set [x v] to [0]\n    set [y v] to [-280]\n    create clone of (_myself_ v)\n    set [x v] to [100000000000000000000]\n    set [y v] to [0]\n    set [id v] to [0]\n    set [id v] to [3]\nend\nif <(Level) = [12]> 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 start as a clone\nforever\n    if <(id) = [20]> then\n        wait until <(key.unlock) = [1]>\n        wait until <(key.unlock) = [0]>\n        start sound [coin smw v]\n        repeat (3)\n            change [ghost v] effect by (25)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [setup 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 <[equipped v] contains [4]?> then\n            set [sy v] to [8]\n        else\n            if <(air) < [1]> then\n                if <[equipped v] contains [1]?> then\n                    set [sy v] to [24]\n                else\n                    set [sy v] to [17]\n                end\n                change [stats:jumps v] by (1)\n            end\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 <[equipped v] contains [2]?> then\n            set [sy v] to [22]\n            if <(sx) > [0]> then\n                set [sx v] to [-20]\n            else\n                set [sx v] to [20]\n            end\n        else\n            set [sy v] to [12]\n            if <(sx) > [0]> then\n                set [sx v] to [-20]\n            else\n                set [sx v] to [20]\n            end\n        end\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\nset [level v] to [-1]\nbroadcast (story v) and wait\nbroadcast (start background fog v)\nset [level v] to [1]\nIntialize\nbroadcast (next2 v)\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            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            ScrollYMin\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        Intialize\n        broadcast (next2 v)\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 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                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (1 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (2 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (3 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (4 v)\n                            end\n                        end\n                        repeat (7)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (5 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (4 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (3 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (2 v)\n                            end\n                        end\n                        repeat (1)\n                            if <(die) = [1]> then\n                                switch costume to (5 v)\n                            else\n                                switch costume to (1 v)\n                            end\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) = [6]> then\n    if <(SCROLL Y) < [-100]> then\n        set [scroll y v] to [-100]\n    end\nend\nif <(Level) = [7]> then\n    if <(SCROLL Y) < [-100]> then\n        set [scroll y v] to [-100]\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    if <(SCROLL Y) < [-190]> then\n        set [scroll y v] to [-190]\n    end\nend\nif <(Level) = [10]> then\n    if <(SCROLL Y) < [-190]> then\n        set [scroll y v] to [-190]\n    end\nend\nif <(Level) = [11]> then\n    if <(SCROLL Y) < [-100]> then\n        set [scroll y v] to [-100]\n    end\n    if <[50] < (SCROLL Y)> then\n        set [scroll y v] to [50]\n    end\nend\nif <(Level) = [12]> then\n    if <(SCROLL Y) < [-100]> then\n        set [scroll y v] to [-100]\n    end\nend\nif <(Level) = [12]> then\n    if <(SCROLL X) < [-200]> then\n        set [scroll x v] to [-200]\n    end\nend\nif <(Level) = [12]> then\n    if <[800] < (SCROLL X)> then\n        set [scroll x v] to [800]\n    end\nend\nif <(Level) = [13]> then\n    set [scroll x v] to [0]\n    if <(SCROLL Y) < [-100]> then\n        set [scroll y v] to [-100]\n    end\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 flag clicked\nset [introtext v] to [0]\n\nwhen I receive [stoap v]\nstop [other scripts in sprite v]\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    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) = [10]> 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) = [11]> 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) = [12]> 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\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\nwhen flag clicked\ndelete all of [equipped v]\n\ndelete this clone\n\nif <(Level) = [14]> 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\n\ndefine clone\nchange [id v] by (1)\nchange [x v] by (450)\nset [y v] to [0]\ncreate clone of (_myself_ v)\n\nwhen I receive [stoap v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [setup 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 @ [420] [123]\nend\nif <(Level) = [6]> then\n    new portal @ [611] [-70]\nend\nif <(Level) = [9]> then\n    new portal @ [833] [-95]\nend\nif <(Level) = [10]> then\n    new portal @ [256] [-130]\nend\nif <(Level) = [11]> then\n    new portal @ [275] [-100]\nend\nif <(Level) = [12]> then\n    new portal @ [800] [240]\nend\nif <(Level) = [13]> then\n    new portal @ [200] [204]\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 (black v)\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nclear graphic effects\nforever\n    go to [front v] layer\n    go [backward v] (11) layers\nend\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) = [12]> then\n    broadcast (stoap v)\n    broadcast (hide bar v)\n    erase all\nelse\n    change [level v] by (1)\nend\ngo to x: (0) y: (0)\nswitch costume to (black v)\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 [story v]\nswitch costume to (black v)\nwait (0.2) seconds\nhide\nset [id v] to [0]\nrepeat (4)\n    change [id v] by (1)\n    create clone of (_myself_ v)\n    wait (2) seconds\nend\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nwait (2) seconds\nbroadcast (go v)\nwait (0.5) seconds\n\nwhen I start as a clone\nset y to (-150)\nset size to (0) %\nrepeat (15)\n    change [ghost v] effect by (-4)\n    change y by (((y position) - (-100)) / (-3))\nend\nrepeat (300)\n    show\n    set [brightness v] effect to (100)\n    switch costume to (id)\n    change size by (((size) - (80)) / (-3))\n    change [ghost v] effect by (0.5)\n    change y by (1)\nend\ndelete this clone\n\nwhen I receive [go v]\nif <(costume [name v]) = [black]> then\n    go to x: (0) y: (0)\n    switch costume to (black v)\n    show\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (0) seconds\nend\n\nwhen I receive [next2 v]\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\nwhen I receive [go v]\nwait (2.6) seconds\nset [introtext v] to [1]\n\nwhen I receive [stoap v]\nswitch costume to (black v)\nwait (0.2) seconds\nhide\nset [id v] to [6]\nrepeat (3)\n    change [id v] by (1)\n    create clone of (_myself_ v)\n    wait (2) seconds\nend\nwait (1) seconds\nchange [id v] by (1)\ncreate clone of (_myself_ v)\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]\nset volume to (100) %\nwait until <(introtext) = [1]>\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) + (45))\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 <(mode) = [1]> then\n                    if <(mute) = [0]> then\n                        if <touching (mouse-pointer v)?> then\n                            set [mute v] to [1]\n                            switch costume to (12 v)\n                        end\n                    else\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                        set [mute.sound v] to [1]\n                    else\n                        set [mute.sound v] to [0]\n                    end\n                end\n                if <(mode) = [3]> then\n                    if <(win?) = [0]> 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                    set [die v] to [1]\n                    change [stats:restart v] by (1)\n                end\n                if <(mode) = [5]> then\n                    if <(shop) > [0]> then\n                        set [shop v] to [-1]\n                    else\n                        set [shop v] to [30]\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                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                repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                    change size by (((size) - (100)) / (-5))\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        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\n    play sound [Odyssey Legend of the Eagle Bearer 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\nwhen I receive [show bar v]\nset [menu.of v] to [0]\n\nwhen flag clicked\nset [shop v] to [-1]\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 [-203] to [-36] at this y area (+-180) [-100]\nend\nif <(Level) = [4]> then\n    Grass from [451] to [525] at this y area (+-180) [-157]\nend\nif <(Level) = [12]> then\n    Grass from [0] to [40] at this y area (+-180) [22]\n    wait (0.1) seconds\n    Grass from [80] to [194] at this y area (+-180) [-10]\n    wait (0.1) seconds\n    Grass from [-200] to [-50] at this y area (+-180) [-10]\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\nif <(Level) = [6]> then\n    Grass from [-221] to [83] at this y area (+-180) [-120]\nend\nif <(Level) = [9]> then\n    Grass from [-172] to [-122] at this y area (+-180) [-171]\nend\nif <(Level) = [10]> then\n    Grass from [-200] to [-59] at this y area (+-180) [-130]\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 [velocity.2.intro v] to (((velocity.2.intro) * (0.7)) + (((x.intro) - (0)) * (-0.2)))\nchange [x.intro v] by ([floor v] of (velocity.2.intro) )\nbroadcast (set v)\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]\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 (6) seconds\n    set [win? v] to [0]\n    reset timer\n    hide\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 (logo v)\n    set [ghost v] effect to (0)\n    show\nend\nif <(id) = [0]> then\n    switch costume to (title1 v)\n    set [ghost v] effect to (20)\n    show\nend\nif <(id) = [2]> then\n    switch costume to (title2 v)\n    set [ghost v] effect to (30)\nend\n\nwhen I receive [start background fog v]\nhide\ndelete this clone\n\nwhen I receive [intro v]\nwait (1) seconds\nchange [x.intro v] by (500)\nswitch costume to (hack!size v)\ngo to x: (500) y: (0)\nif <(id) = [1]> then\n    switch costume to (logo v)\n    set [ghost v] effect to (0)\n    show\nend\nif <(id) = [0]> then\n    switch costume to (title1 v)\n    set [ghost v] effect to (20)\n    show\nend\nif <(id) = [2]> then\n    switch costume to (title2 v)\n    set [ghost v] effect to (30)\nend\n\nwhen I receive [intro v]\nwait (1) seconds\nrepeat (100)\n    if <(id) = [1]> then\n        xb\n    end\nend\n\nwhen I receive [set v]\nswitch costume to (hack!size v)\nset x to (x.intro)\nif <(id) = [1]> then\n    switch costume to (logo v)\n    set [ghost v] effect to (0)\n    show\nend\nif <(id) = [0]> then\n    switch costume to (title1 v)\n    set [ghost v] effect to (20)\n    show\nend\nif <(id) = [2]> then\n    switch costume to (title2 v)\n    set [ghost v] effect to (30)\n    if <key (o v) pressed?> then\n        next costume\n    end\nend\n\nwhen I receive [story v]\ndelete this clone\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\nswitch costume to (pick random (1) to (2))\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 (50)\nforever\n    change [ghost v] effect by (1)\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 (-1)\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 (0)\nwait (1.5) seconds\ngo to x: (pick random (-100) to (100)) y: (-180)\nclone [25] [15]\nwait (1) seconds\ngo to x: (pick random (-100) to (100)) y: (-180)\nclone [25] [15]\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] (24) 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 [-166]\n            set [y v] to [0]\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 [323]\n                    set [y v] to [50]\n                    create clone of (_myself_ v)\n                    set [x v] to [457]\n                    set [y v] to [50]\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 [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] (5) layers\n        xb [2]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(shop) > [0]> then\n        wait (0.2) seconds\n        repeat until <not <(shop) > [0]>>\n            if <<mouse down?> and <not <touching (mouse-pointer v)?>>> then\n                set [shop v] to [-1]\n            end\n        end\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]\nset size to (90) %\nposition (((x) + (([cos v] of ((timer) * (x\[\])) ) * (x\(\)))) - (SCROLL X)) ((((y) + (y+)) - (SCROLL Y)) + (([cos v] of ((timer) * (y\(\))) ) * (y\[\])))\n\nwhen I receive [setup v]\nset [mode v] to []\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [3]> then\nif <(Level) = [5]> then\n    new saw @ [40] [-160] 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 @ [-5] [-162] sinus y [] [] id [1] sinus x [] [] y+ [50]\n    new saw @ [250] [0] sinus y [] [] id [2] sinus x [] [] y+ []\nend\nif <(Level) = [6]> then\n    new saw @ [262] [-110] sinus y [] [] id [1] sinus x [] [] y+ [20]\n    new saw @ [392] [-110] sinus y [] [] id [1] sinus x [] [] y+ [50]\n    new saw @ [522] [-110] sinus y [] [] id [1] sinus x [] [] y+ [80]\nend\nif <(Level) = [11]> then\n    new saw @ [250] [0] sinus y [] [] id [2] sinus x [] [] y+ []\nend\nset [id v] to [0]\nset [x v] to [10000]\nset [x v] to [10000]\n\ndefine position (x) (y)\nshow\ngo to [back v] layer\nswitch costume to (saw v)\ngo to x: (x) y: (y)\nset [brightness v] effect to (0)\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 (100) %\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 [Bonk v]\n                end\n            end\n        end\n        if <<(x) = (x position)> and <(y) = (y position)>> then\n            show\n            if <touching (box v)?> then\n                set [die v] to [1]\n            end\n        else\n            hide\n        end\n    else\n        if <(id) = [2]> then\n            if <((timer) mod (2)) < [1.2]> then\n                if <<(x) = (x position)> and <(y) = (y position)>> then\n                    start sound [Boom Cloud v]\n                    show\n                else\n                    hide\n                end\n                change x by (pick random (-1) to (1))\n                change y by (pick random (-1) to (1))\n                point in direction (90)\n                if <(Level) = [11]> then\n                    switch costume to (costume2 v)\n                else\n                    switch costume to (costume1 v)\n                end\n                set size to (100) %\n            else\n                hide\n            end\n            if <touching (box v)?> then\n                set [die v] to [1]\n            end\n        else\n            point in direction (([cos v] of ((timer) * (120)) ) * (150))\n            if <<(x) = (x position)> and <(y) = (y position)>> then\n                show\n            else\n                hide\n            end\n        end\n    end\nelse\n    turn right (3) degrees\nend\ngo [backward v] (80) layers\nif <touching (box v)?> then\n    set [die v] to [1]\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 start as a clone\nforever\n    go to [back v] layer\nend\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]\nif <(y\[\]) > [0]> then\n    point in direction ((([sin v] of ((timer) * (200)) ) * (10)) + (90))\n    position ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + (([cos v] of ((timer) * (y\(\))) ) * (y\[\])))\nelse\n    point in direction ((([cos v] of ((timer) * (200)) ) * (10)) + (90))\n    position ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + (([sin v] of ((timer) * (y\(\))) ) * ((y\[\]) * (-1))))\nend\n\nwhen I receive [setup v]\nset [key.unlock v] to [0]\nwait (0.1) seconds\nclear graphic effects\nhide\nif <(Level) = [2]> then\n    new item @ [150] [-60] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [290] [-20] sinus x [] [] sinus y [200] [-20] [1] type [1]\n    new item @ [430] [20] sinus x [] [] sinus y [200] [20] [1] type [1]\nend\nif <(Level) = [3]> then\n    new item @ [40] [110] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [40] [40] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [295] [220] sinus x [] [] sinus y [200] [-20] [1] type [1]\n    new item @ [295] [150] 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 [2]\n    new item @ [520] [-50] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [470] [25] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [520] [100] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [470] [175] sinus x [] [] sinus y [200] [20] [1] type [1]\n    new item @ [1015] [400] sinus x [] [] sinus y [200] [20] [1] type [1]\nend\nif <(Level) = [5]> then\n    new item @ [-714] [-100] sinus x [] [] sinus y [200] [20] [4] type [2]\n    new item @ [408] [-100] sinus x [] [] sinus y [200] [20] [3] type [1]\n    new item @ [618] [-60] sinus x [] [] sinus y [200] [20] [3] type [1]\n    new item @ [818] [-20] sinus x [] [] sinus y [200] [20] [3] type [1]\nend\nif <(Level) = [8]> then\n    new item @ [400] [100] sinus x [] [] sinus y [200] [20] [4] type [2]\n    new item @ [100] [-100] sinus x [] [] sinus y [200] [-20] [1] type [1]\n    new item @ [570] [100] sinus x [] [] sinus y [200] [20] [4] type [1]\nend\nif <(Level) = [6]> then\n    new item @ [460] [-50] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [328] [-50] sinus x [] [] sinus y [200] [-20] [6] type [1]\n    new item @ [190] [-50] sinus x [] [] sinus y [200] [20] [6] type [1]\nend\nif <(Level) = [7]> then\n    new item @ [310] [50] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [310] [-25] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [200] [100] sinus x [] [] sinus y [200] [20] [6] type [2]\nend\nif <(Level) = [9]> then\n    new item @ [385] [-260] sinus x [] [] sinus y [200] [20] [6] type [2]\n    new item @ [150] [-100] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [600] [-100] sinus x [] [] sinus y [200] [20] [6] type [1]\nend\nif <(Level) = [10]> then\n    new item @ [-70] [100] sinus x [] [] sinus y [200] [20] [6] type [2]\n    new item @ [510] [50] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [510] [-30] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [510] [-110] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [925] [-200] sinus x [] [] sinus y [200] [20] [6] type [3]\nend\nif <(Level) = [11]> then\n    new item @ [-760] [-150] sinus x [] [] sinus y [200] [20] [6] type [3]\n    new item @ [-629] [-40] sinus x [] [] sinus y [200] [20] [6] type [1]\nend\nif <(Level) = [12]> then\n    new item @ [449] [0] sinus x [] [] sinus y [200] [20] [6] type [1]\n    new item @ [530] [0] sinus x [] [] sinus y [200] [-20] [6] type [1]\n    new item @ [610] [370] sinus x [] [] sinus y [200] [20] [6] type [2]\nend\nset [x v] to [10000]\n\ndefine position (x) (y)\nif <(get) = [0]> then\n    clear graphic effects\n    set [ghost v] effect to (35)\n    if <(type) = [4]> then\n        go to [front v] layer\n        go to x: ([x position v] of [box v]) y: (([y position v] of [box v]) + ((50) + (([cos v] of ((timer) * (y\(\))) ) * ((y\[\]) / (3)))))\n        switch costume to (diamond3 v)\n        show\n        set size to (100) %\n        switch costume to (diamond3 v)\n        set [brightness v] effect to (-30)\n        if <(key.unlock) = [0]> then\n            delete this clone\n        end\n    else\n        if <(type) = [1]> then\n            switch costume to (coin v)\n            set size to (60) %\n            point in direction (90)\n        else\n            if <(type) = [2]> then\n                set size to (100) %\n                switch costume to (diamond v)\n                set [brightness v] effect to (0)\n            else\n                set size to (100) %\n                switch costume to (diamond3 v)\n                set [brightness v] effect to (-30)\n            end\n        end\n        go to x: (x) y: (y)\n        if <<(x) = (x position)> and <(y) = (y position)>> then\n            show\n        else\n            hide\n        end\n    end\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\n\nwhen flag clicked\nforever\n    change [itemget v] by (-1)\nend\n\nwhen I start as a clone\nforever\n    if <touching (box v)?> then\n        if <(die) = [0]> then\n            if <(type) = [3]> then\n                set [key.unlock v] to [1]\n                if <(mute.sound) = [0]> then\n                    set volume to (35) %\n                    start sound [SE_KeyGet v]\n                end\n                set [type v] to [4]\n                stop [this script v]\n            else\n                stop [other scripts in sprite v]\n                set [itemget v] to [29]\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                if <(mute.sound) = [0]> then\n                    set volume to (35) %\n                    if <(type) = [1]> then\n                        start sound [coin v]\n                    else\n                        start sound [unlock v]\n                    end\n                end\n                next costume\n                repeat (10)\n                    change [ghost v] effect by (8)\n                    change size by (20)\n                    go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n                    if <<((x) - (SCROLL X)) = (x position)> and <((y) - (SCROLL Y)) = (y position)>> then\n                        show\n                    else\n                        hide\n                    end\n                end\n                delete this clone\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@Sprite5\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (20)\n    show\n    go to [front v] layer\n    go [backward v] (1) layers\n    switch costume to (.0 v)\n    set x to (-60)\n    if <(shop) < [0]> then\n        if <(itemget) < [0]> then\n            xb [0]\n        else\n            xb [1]\n        end\n    else\n        xb [2]\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@score3\n\nwhen I start as a clone\nswitch costume to (letter (i) of (Score))\nforever\n    go to [front v] layer\n    clear graphic effects\n    set [ghost v] effect to (20)\n    set [brightness v] effect to (-100)\n    set size to (45) %\n    show\n    set x to ((-175) + (((i) - ()) * (15)))\n    switch costume to (letter (i) of (stats: coins))\nend\n\nwhen I start as a clone\nforever\n    if <(shop) < [0]> then\n        if <(itemget) < [0]> then\n            xb [0]\n        else\n            xb [1]\n        end\n    else\n        xb [2]\n    end\nend\n\nwhen flag clicked\nset [i v] to [0]\nrepeat (3)\n    change [i v] by (1)\n    create clone of (_myself_ v)\nend\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.2)) + (((y position) - (-84)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-159)) * (-0.3)))\n    else\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-200)) * (-0.05)))\n    end\nend\nchange y by (vel)\n\n@score2\n\nwhen I start as a clone\nswitch costume to (letter (i) of (Score))\nforever\n    go to [front v] layer\n    clear graphic effects\n    set [ghost v] effect to (20)\n    set [brightness v] effect to (-100)\n    set size to (45) %\n    show\n    set x to ((-40) + (((i) - ()) * (15)))\n    switch costume to (letter (i) of (stats: diamonds))\nend\n\nwhen I start as a clone\nforever\n    if <(shop) < [0]> then\n        if <(itemget) < [0]> then\n            xb [0]\n        else\n            xb [1]\n        end\n    else\n        xb [2]\n    end\nend\n\nwhen flag clicked\nset [i v] to [0]\nrepeat (3)\n    change [i v] by (1)\n    create clone of (_myself_ v)\nend\n\ndefine xb (b)\nif <(b) = [2]> then\n    set [vel v] to (((vel) * (0.2)) + (((y position) - (-84)) * (-0.3)))\nelse\n    if <(b) = [1]> then\n        set [vel v] to (((vel) * (0.6)) + (((y position) - (-159)) * (-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@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 (92)\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]\n    new light at [-165] [20]\nend\nif <(Level) = [2]> then\n    new light at [-220] [0]\n    new light at [410] [-120]\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 light at [-230] [-250]\n    new light at [435] [95]\n    new light at [80] [-250]\n    Draw sj at [40] [-120] (sj)\n    Draw sj at [295] [-20] (sj)\n    new lava pool at [-1000] [-500] length [800] height [200]\n    new lava pool at [0] [-500] length [1600] height [200]\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 [2000] height [200]\n    new lava pool at [250] [-500] length [200] height [300]\n    new lava pool at [450] [-500] length [200] height [320]\n    new lava pool at [600] [-500] length [200] height [360]\n    new lava pool at [800] [-500] length [1000] height [300]\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 [2300] height [100]\n    Draw sj at [575] [-50] (sj)\nend\nif <(Level) = [7]> then\n    new light at [-250] [-100]\n    Draw sj at [308] [-90] (sj)\nend\nif <(Level) = [6]> then\n    new light at [-140] [40]\n    new light at [600] [0]\nend\nif <(Level) = [9]> then\n    new lava pool at [-750] [-430] length [2300] height [100]\n    new light at [-114] [-250]\nend\nif <(Level) = [10]> then\n    new light at [-270] [-20]\n    new light at [435] [-150]\n    new lava pool at [100] [-500] length [1700] height [150]\n    Draw sj at [23] [-80] (sj)\nend\nif <(Level) = [11]> then\n    new lava pool at [-2000] [-450] length [2700] height [200]\n    new light at [40] [-180]\nend\nif <(Level) = [12]> then\n    new lava pool at [-1000] [-400] length [800] height [200]\n    new lava pool at [178] [-400] length [200] height [370]\n    new lava pool at [700] [-400] length [1000] height [370]\n    new light at [580] [100]\nend\nif <(Level) = [13]> then\n    new light at [-120] [-60]\n    new light at [-5] [250]\nend\n\nDraw sj at [449] [50] (sj)\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) / (5)) )\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        set pen (transparency v) to (10)\n        pen down\n        go to x: (((x) + ((i) * (10))) - (SCROLL X)) y: (((y) + ((h) + (([sin v] of (((timer) + ((i) * (0.15))) * (200)) ) * (5)))) - (SCROLL Y))\n        pen up\n    end\n    change [i v] by (0.5)\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\n    if <(Level) = [-1]> then\n        erase all\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 (#000000)\n    set pen size to (4)\n    set pen (transparency v) to (50)\n    set [i v] to [4]\n    go to x: (((x) - (-12)) - (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) - (-12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        end\n        pen down\n        set pen color to (#000000)\n        set pen size to (7)\n        set pen (transparency v) to (0)\n    end\n    pen up\n    set [i v] to [4]\n    go to x: (((x) - (10)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n    pen down\n    set pen color to (#000000)\n    set pen size to (7)\n    set pen (transparency v) to (0)\n    repeat (4)\n        change [i v] by (-1)\n        if <([floor v] of ((i) / (2)) ) = ((i) / (2))> then\n            go to x: (((x) - (12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (-12)) - (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 (16)\n    set pen color to (#000000)\n    pen down\n    go to x: (((x) - (-18)) - (SCROLL X)) y: (((y) + (h)) - (SCROLL Y))\n    pen up\nend\nif <([abs v] of (((x) - ()) - (SCROLL X)) ) < [270]> then\n    pen up\n    set pen color to (#000000)\n    set pen size to (4)\n    set pen (transparency v) to (50)\n    set [i v] to [4]\n    go to x: (((x) - (-12)) - (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) - (-12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        end\n        pen down\n        set pen color to (#5f6060)\n        set pen size to (4)\n        set pen (transparency v) to (0)\n    end\n    pen up\n    set [i v] to [4]\n    go to x: (((x) - (10)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n    pen down\n    set pen color to (#575758)\n    set pen size to (4)\n    set pen (transparency v) to (0)\n    repeat (4)\n        change [i v] by (-1)\n        if <([floor v] of ((i) / (2)) ) = ((i) / (2))> then\n            go to x: (((x) - (12)) - (SCROLL X)) y: ((((y) + (h)) + (((((50) + (h)) - ()) / (-4)) * (i))) - (SCROLL Y))\n        else\n            go to x: (((x) - (-12)) - (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 (12)\n    set pen color to (#5e5e5e)\n    pen down\n    go to x: (((x) - (-18)) - (SCROLL X)) y: (((y) + (h)) - (SCROLL Y))\n    pen up\nend\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@Sprite6\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (25)\n    show\n    go to [front v] layer\n    go [backward v] (0) layers\n    switch costume to (.0 v)\n    set x to (-135)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [1]?>> then\n        if <(stats: coins) > [9]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (30)\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [1] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [stats: coins v] by (-10)\n                    end\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.2 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (-127.5)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\n@Sprite7\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (25)\n    show\n    go to [front v] layer\n    switch costume to (.0 v)\n    set x to (30)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [2]?>> then\n        if <(stats: coins) > [19]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (30)\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [2] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [stats: coins v] by (-20)\n                    end\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.2 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (-127.5)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\n@Sprite8\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    switch costume to (.0 v)\n    set x to (170)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [4]?>> then\n        if <(stats: diamonds) > [7]> then\n            set [ghost v] effect to (25)\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (30)\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [4] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [stats: diamonds v] by (-8)\n                    end\n                else\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.2 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (-127.5)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\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@Thumbnail\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [after-update v]\ngo to [front v] layer\n\n