Industrial || Platformer 

Instructions: Instructions:\n• Use the arrow keys to control the player.\n• Avoid spikes and water.\n• Press red buttons to deactivate lasers.\n• Some tiles crumble under your weight.\n• Tip: Holding down the up key will allow you to jump higher!

@Stage\n\nwhen flag clicked\nset volume to (50) %\nforever\n    if <<(SCENE #) = [1]> or <<(SCENE #) = [2]> or <<(SCENE #) = [3]> or <<(SCENE #) = [4]> or <<(SCENE #) = [101]> or <<(SCENE #) = [102]> or <<(SCENE #) = [103]> or >>>>>>> then\n        switch backdrop to (backdrop1 v)\n    else\n        if <<(SCENE #) = [5]> or <<(SCENE #) = [6]> or <<(SCENE #) = [7]> or >>> then\n            switch backdrop to (backdrop1 v)\n        else\n            if <<(SCENE #) = [8]> or <<(SCENE #) = [9]> or <<(SCENE #) = [10]> or <<(SCENE #) = [11]> or <<(SCENE #) = [108]> or <<(SCENE #) = [109]> or <<(SCENE #) = [110]> or >>>>>>> then\n                switch backdrop to (backdrop1 v)\n            else\n                if <<(SCENE #) = [12]> or <<(SCENE #) = [13]> or <<(SCENE #) = [14]> or <<(SCENE #) = [15]> or <<(SCENE #) = [112]> or <<(SCENE #) = [113]> or <<(SCENE #) = [114]> or >>>>>>> then\n                    switch backdrop to (backdrop1 v)\n                end\n            end\n        end\n    end\nend\n\nwhen [m v] key pressed\nif <(volume) = [50]> then\n    set volume to (0) %\nelse\n    set volume to (50) %\nend\n\nwhen flag clicked\nwait (1) seconds\nforever\n    play sound [Music v] until done\nend\n\n@Player\n\nwhen flag clicked\npoint in direction (90)\nset size to (50) %\nset [scene # v] to [1]\nset [checkpoint# v] to [0]\nbroadcast (Change Scene v)\nset [gravity v] to [-1.5]\nset [jump force v] to [14]\nset [jump duration v] to [6]\nset [acceleration v] to [1.8]\nset [resistance v] to [0.8]\nset [speed y v] to [0]\nbroadcast (Setup v) and wait\nRestart and  Begin Level\n\ndefine Move In Steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    Check Touching Solid\n    if <(TOUCHING) > [0]> then\n        Collide X - Slope or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    Check Touching Solid\n    if <(TOUCHING) > [0]> then\n        Collide Y - Ceiling or Floor?\n    end\nend\n\ndefine Check Touching Solid\nif <<<touching (level v)?> or <touching (platform v)?>> or <<touching (breakable blocks v)?> or <<touching (lock 1 v)?> or <<touching (boat v)?> or >>>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick player v]\nMoved - by Moving Platform\nControls - UP and DOWN\nControls - LEFT and RIGHT\nMove In Steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nSet Costume\n\ndefine Controls - UP and DOWN\nif <key (up arrow v) pressed?> then\n    if <<(wall slide) > [0]> and <(JUMPING) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn left (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n    end\n    if <<(FALLING) < [3]> and <(JUMPING) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(JUMPING) > [0]> and <(JUMPING) < (JUMP DURATION)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (JUMP FORCE)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (GRAVITY)\nif <(wall slide) > [0]> then\n    Check Can Wall Slide\n    if <(speed y) < [0]> then\n        set [speed y v] to ((speed y) * (0.6))\n    end\nend\n\ndefine Controls - LEFT and RIGHT\nif <(Long Jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\nif <(KEY X) = [0]> then\n    if <<(FALLING) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((KEY X) * (ACCELERATION))\n    point in direction ((KEY X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (RESISTANCE))\n\ndefine Restart and  Begin Level\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\nif <(CHECKPOINT#) = [0]> then\n    Begin Scene # [1] Go to X, Y [-160] [25]\nend\nif <(CHECKPOINT#) = [0]> then\n    set [scene # v] to [1]\n    go to x: (-160) y: (25)\nelse\n    if <(CHECKPOINT#) = [1]> then\n        set [scene # v] to [3]\n        go to x: (-214) y: (57)\n    else\n        if <(CHECKPOINT#) = [2]> then\n            set [scene # v] to [5]\n            go to x: (-134) y: (-40)\n        else\n            if <(CHECKPOINT#) = [3]> then\n                set [scene # v] to [7]\n                go to x: (-210) y: (67)\n            else\n                if <(CHECKPOINT#) = [4]> then\n                    set [scene # v] to [11]\n                    go to x: (-203) y: (-32)\n                else\n                    if <(CHECKPOINT#) = [5]> then\n                        set [scene # v] to [12]\n                        go to x: (-211) y: (-80)\n                    else\n                        if <(CHECKPOINT#) = [6]> then\n                            set [scene # v] to [115]\n                            go to x: (-214) y: (108)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\npoint in direction (90)\nbroadcast (Game Loop v)\nbroadcast (Next v)\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick First v)\n    broadcast (Tick - platforms v)\n    broadcast (Tick- Smash v)\n    broadcast (Tick Player v)\n    broadcast (Tick Last v)\n    Detection\nend\n\nwhen I receive [tick last v]\nif <(x position) > [235]> then\n    Begin Scene # ((SCENE #) + (1)) Go to X, Y [-235] []\n    broadcast (Next v)\nend\nif <(x position) < [-235]> then\n    Begin Scene # ((SCENE #) + (-1)) Go to X, Y [235] []\n    broadcast (Next v)\nend\nif <(y position) > [180]> then\n    Begin Scene # ((SCENE #) + (100)) Go to X, Y [] [-160]\n    broadcast (Next v)\nend\nif <(y position) < [-180]> then\n    Begin Scene # ((SCENE #) + (-100)) Go to X, Y [] [180]\n    broadcast (Next v)\nend\n\ndefine Begin Scene # (scene #) Go to X, Y (x) (y)\nset [scene # v] to (scene #)\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collisions in Direction [0]\nelse\n    Fix Collisions in Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collisions in Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(TOUCHING) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(FALLING) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(Frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((Frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Solid\n        if <(TOUCHING) < [1]> then\n            switch costume to ((costume [number v]) + (5))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\ndefine Collide X - Slope or Wall?\nCheck Can Wall Slide\nchange y by (1)\nCheck Touching Solid\nif <(TOUCHING) > [0]> then\n    change y by (1)\n    Check Touching Solid\n    if <(TOUCHING) > [0]> then\n        change y by (-2)\n        set x to (last value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((speed x) * (0.8))\nend\nset [speed x v] to ((speed x) * (0.95))\nSlip\n\ndefine Collide Y - Ceiling or Floor?\nset y to (last value)\nif <(speed y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(FALLING) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((speed y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck Touching Solid\nif <(TOUCHING) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching Solid\nif <(TOUCHING) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Check Can Wall Slide\nif <(FALLING) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\nCheck Touching Solid\nset [wall slide v] to (TOUCHING)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\ndefine Detection\nif <<touching (spikes v)?> or <<touching (water v)?> or >> then\n    broadcast (Change Scene v)\n    if <<touching (spikes v)?> or > then\n        start sound [Explode v]\n    else\n        if <touching (water v)?> then\n            start sound [Splash v]\n        end\n    end\n    broadcast (show v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Restart and  Begin Level\n    broadcast (Next v)\n    broadcast (reset breakable blocks v)\nend\nif <<touching (orbs v)?> and <key (up arrow v) pressed?>> then\n    set [speed y v] to ((JUMP FORCE) + (3))\n    broadcast (Des v)\nend\nif <touching (move area v)?> then\n    change x by (3)\nend\nif <touching (rightmove v)?> then\n    change x by (-3)\nend\nif <touching (upmove v)?> then\n    set [speed y v] to [4]\nend\n\ndefine Moved - by Moving Platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nCheck Touching Solid\nif <(TOUCHING) > [0]> then\n    Find Closest Space to (x position) (y position) max [16]\n    if <(TOUCHING) > [0]> then\n        broadcast (Lose v)\n    end\nend\n\ndefine Find Closest Space to (x) (y) max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n    end\n    Check Touching Solid\n    if <(TOUCHING) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    turn right (22.5) degrees\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\nwhen I receive [lose life v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nstart sound [Explode v]\n\nset [acceleration v] to [1.75]\n\nset [ghost v] effect to (0)\n\nset [scene # v] to [115]\ngo to x: (-214) y: (108)\n\nset [checkpoint# v] to [6]\n\nwhen I receive [lose v]\nstop [other scripts in sprite v]\nstart sound [Explode v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nRestart and  Begin Level\nbroadcast (Next v)\n\nclear graphic effects\n\nset [acceleration v] to [1.8]\n\n@Button1\n\nwhen flag clicked\nswitch costume to (1 v)\nset [pressed? v] to [0]\nwait until <touching (player v)?>\nstart sound [Press v]\nswitch costume to (2 v)\nset [pressed? v] to [1]\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    if <(SCENE #) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (join [Scene] (SCENE #))\nend\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nset [ghost v] effect to (00)\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    switch costume to (join [Scene] (SCENE #))\nend\n\n@Decoration\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\n    switch costume to (join [Scene] (SCENE #))\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\ngo to (random position v)\n\n@Breakable blocks\n\nwhen flag clicked\nhide\n\ndefine Clone At X: (x) (y) At Size: (size)\nset size to (size) %\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [next v]\nif  then\n    delete this clone\nend\nif <(SCENE #) = [5]> then\n    Clone At X: [53] [-50] At Size: [100]\nend\nif <(SCENE #) = [6]> then\n    Clone At X: [-44] [-59] At Size: [100]\n    Clone At X: [25] [10] At Size: [100]\nend\nif <(SCENE #) = [8]> then\n    Clone At X: [85] [35] At Size: [100]\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo [backward v] (3) layers\nclear graphic effects\nswitch costume to (1 v)\nforever\n    if <touching (player v)?> then\n        start sound [Crumble v]\n        repeat (25)\n            change y by (-3)\n            change [ghost v] effect by (4)\n        end\n        delete this clone\n    end\nend\n\nbroadcast (Next v)\n\nwhen [m v] key pressed\nset [mouse v] to (join (join (mouse x) [ ]) (mouse y))\n\nif <touching (player v)?> then\n\nClone At X: [-48] [-87] At Size: [90]\n\nwhen I receive [reset breakable blocks v]\n\nif  then\n    delete this clone\nend\nif <(SCENE #) = [8]> then\n    Clone At X: [62] [40] At Size: [100]\n    Clone At X: [140] [20] At Size: [100]\nend\nif <(SCENE #) = [9]> then\n    Clone At X: [136] [-10] At Size: [100]\nend\nif <(SCENE #) = [11]> then\n    Clone At X: [-75] [-24] At Size: [90]\n    Clone At X: [-20] [55] At Size: [90]\nend\nif <(SCENE #) = [13]> then\n    Clone At X: [3] [12] At Size: [90]\n    Clone At X: [80] [-4] At Size: [90]\nend\nif <(SCENE #) = [14]> then\n    Clone At X: [56] [40] At Size: [90]\nend\nif <(SCENE #) = [115]> then\n    Clone At X: [-83] [-160] At Size: [90]\n    Clone At X: [-45] [-160] At Size: [90]\n    Clone At X: [-7] [-160] At Size: [90]\n    Clone At X: [31] [-160] At Size: [90]\n    Clone At X: [69] [-160] At Size: [90]\n    Clone At X: [107] [-160] At Size: [90]\n    Clone At X: [145] [-160] At Size: [90]\n    Clone At X: [183] [-160] At Size: [90]\n    Clone At X: [221] [-160] At Size: [90]\nend\n\n@Arrows\n\nwhen flag clicked\nhide\nforever\n\nif <(SCENE #) = [3]> then\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nforever\n    change x by (5)\nend\n\nwhen I start as a clone\nif <(SCENE #) = [3]> then\n    go to x: (-107) y: (12)\n    wait until <(x position) > [30]>\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nchange x by (4)\n\nwhen I receive [next v]\nif  then\n    delete this clone\nend\n\nset [ghost v] effect to (100)\n\n@Water\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    switch costume to (join [Scene] (SCENE #))\n    set y to ((3) * ([sin v] of ((timer) * (180)) ))\n    set [ghost v] effect to (25)\nend\n\nset y to ((3) * ([sin v] of ((timer) * (180)) ))\n\n@Platform\n\nwhen I receive [change scene v]\ngo to [back v] layer\n\ndefine Animate Platform\nforever\n\nwhen I receive [tick - platforms v]\ntick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine tick (new x) (new y)\nif <(new y) > (last y)> then\n    change y by (1)\nelse\n    set y to ((last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (last x))\n    set [platform dy v] to ((new y) - (last y))\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate 2\nforever\n\nwhen I receive [next v]\nif <(SCENE #) = [3]> then\n    Door at [219] [-10] key [Key 1]\nend\nif <(SCENE #) = [5]> then\n    Door at [219] [50] key [Key 2]\nend\n\ndefine Animate 3\nforever\n\nwhen flag clicked\nforever\n    if <not <<(SCENE #) = [3]> or >> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (-30) y: (10)\n\nset x to ((63) * ([sin v] of ((timer) * (60)) ))\n\ndefine Door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Press v]\n        repeat (41)\n            change y by (3.5)\n        end\n        wait (1) seconds\n        repeat (41)\n            change y by (-3.5)\n        end\n        start sound [Boom v]\n        wait until <not <touching (player v)?>>\n    else\n        start sound [Low Boing v]\n        wait until <not <touching (player v)?>>\n    end\nend\n\n@Checkpoint 1\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [3]> then\n        show\n        go to x: (0) y: (0)\n        if <not <(CHECKPOINT#) = [1]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [1]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Checkpoint!\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [1]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [2]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [3]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [4]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [5]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nwait until <(CHECKPOINT#) = [6]>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Black Screen\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [show v]\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (0.25) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nset [ghost v] effect to (100)\n\n@Move Area\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    set [ghost v] effect to (100)\n    switch costume to (join [Scene] (SCENE #))\nend\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nset [ghost v] effect to (3)\n\n@Left\n\nwhen flag clicked\nhide\nforever\nend\n\nif <(SCENE #) = [4]> then\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nelse\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nforever\n    change x by (-5)\n    go to [front v] layer\nend\n\nwhen I start as a clone\ngo to [front v] layer\nif <(SCENE #) = [4]> then\n    go to x: (217) y: (-149)\n    wait until <[5] > (x position)>\nelse\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nchange x by (4)\n\nwhen I receive [next v]\nif  then\n    delete this clone\nend\n\n@RightMove\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    set [ghost v] effect to (100)\n    switch costume to (join [Scene] (SCENE #))\nend\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nset [ghost v] effect to (3)\n\nset [scene # v] to [8]\n\n@Lasers1\n\nwhen flag clicked\nset [laser v] to [0]\nhide\ngo to x: (-30) y: (3)\ngo to [back v] layer\nwait until <(SCENE #) = [2]>\nshow\nswitch costume to (1up v)\ngo [backward v] (1) layers\nforever\n    if <(PRESSED?) = [1]> then\n        switch costume to (1 v)\n    else\n        switch costume to (1up v)\n    end\nend\n\nwhen flag clicked\n\nforever\nend\n\nwhen I receive [next v]\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\nshow\n\nwait until <(SCENE #) = [2]>\n\n@Collectables\n\nwhen I receive [next v]\nif <(SCENE #) = (My Scene)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nrepeat until <touching (player v)?>\n    change y by ((0.5) * ([sin v] of (frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [1]> then\n    start sound [Collect v]\n    change [coins v] by (1)\nelse\n    start sound [Key v]\n    add (costume [name v]) to [collected v]\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [setup v]\ndelete all of [collected v]\nset [coins v] to [0]\nset [frame v] to [0]\nhide\nPlace [1] Scene [1] XY [-95] [10]\nPlace [1] Scene [1] XY [172] [70]\nPlace [1] Scene [2] XY [-77] [-50]\nPlace [1] Scene [2] XY [72] [125]\nPlace [1] Scene [2] XY [185] [31]\nPlace [1] Scene [3] XY [-5] [-14]\nPlace [Key 1] Scene [3] XY [-9] [116]\nPlace [1] Scene [4] XY [-110] [33]\nPlace [1] Scene [4] XY [5] [76]\nPlace [1] Scene [5] XY [-69] [-34]\nPlace [1] Scene [5] XY [170] [10]\nPlace [Key 2] Scene [105] XY [145] [112]\nPlace [1] Scene [6] XY [-120] [0]\nPlace [1] Scene [6] XY [130] [75]\nPlace [1] Scene [8] XY [-145] [75]\n\ndefine Place (name) Scene (scene) XY (x) (y)\nset [my scene v] to (scene)\nswitch costume to (name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nPlace [1] Scene [5] XY [-69] [-34]\n\nchange y by ((0.5) * ([sin v] of (frame) ))\n\nchange y by ((0.5) * ([sin v] of (frame) ))\nchange [frame v] by (5)\n\n@Lasers2\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    go [backward v] (3) layers\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [3]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [next v]\ngo to [back v] layer\nwait until <(SCENE #) = [3]>\nshow\nswitch costume to (1up v)\nrepeat until <not <(SCENE #) = [3]>>\n    set [laser v] to [1]\n    switch costume to (1up v)\n    wait (2) seconds\n    set [laser v] to [0]\n    switch costume to (1 v)\n    wait (2) seconds\nend\nswitch costume to (2up v)\n\nset [laser v] to [0]\nhide\ngo to x: (-30) y: (3)\ngo to [back v] layer\nwait until <(SCENE #) = [3]>\nshow\nswitch costume to (1up v)\nrepeat until <not <(SCENE #) = [3]>>\n    set [laser v] to [1]\n    switch costume to (1up v)\n    wait (2) seconds\n    set [laser v] to [0]\n    switch costume to (1 v)\n    wait (2) seconds\nend\nswitch costume to (2up v)\n\n@Arrow\n\nwhen flag clicked\ngo to [back v] layer\nset [frame2 v] to [0]\ngo to x: (-187) y: (130)\nclear graphic effects\n\nwhen flag clicked\ngo to x: (-187) y: (130)\nforever\n    set y to ((5) * ([sin v] of ((timer) * (180)) ))\nend\n\nwhen I receive [next v]\nif <(SCENE #) = [2]> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nwait until <(PRESSED?) = [1]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Button2\n\nwhen flag clicked\nswitch costume to (1 v)\nset [pressed2? v] to [0]\ngo to x: (11) y: (15)\nwait until <touching (player v)?>\nstart sound [Press v]\nswitch costume to (2 v)\nset [pressed2? v] to [1]\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    if <(SCENE #) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\n@Lasers3\n\nwhen flag clicked\nset [laser v] to [0]\nhide\ngo to x: (-30) y: (3)\ngo to [back v] layer\nwait until <(SCENE #) = [4]>\nshow\nswitch costume to (1up v)\ngo [backward v] (1) layers\nforever\n    if <(pressed2?) = [1]> then\n        switch costume to (1 v)\n    else\n        switch costume to (1up v)\n    end\nend\n\nwhen I receive [next v]\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\nshow\n\nwait until <(SCENE #) = [2]>\n\n@Checkpoint 2\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [5]> then\n        show\n        go to x: (0) y: (0)\n        if <not <(CHECKPOINT#) = [2]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [2]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Lasers4\n\nwhen flag clicked\nforever\n    go [backward v] (3) layers\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [7]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [next v]\ngo to [back v] layer\nwait until <(SCENE #) = [7]>\nshow\nswitch costume to (1up v)\nrepeat until <not <(SCENE #) = [7]>>\n    set [laser v] to [1]\n    switch costume to (1up v)\n    wait (2) seconds\n    set [laser v] to [0]\n    switch costume to (1 v)\n    wait (2) seconds\nend\nswitch costume to (2up v)\n\n@Checkpoint 3\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [7]> then\n        show\n        go to x: (0) y: (0)\n        if <not <(CHECKPOINT#) = [3]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [3]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Lasers5\n\nwhen flag clicked\nforever\n    go [backward v] (3) layers\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [next v]\ngo to [back v] layer\nwait until <(SCENE #) = [8]>\nshow\nswitch costume to (1up v)\nrepeat until <not <(SCENE #) = [8]>>\n    set [laser v] to [1]\n    switch costume to (1up v)\n    wait (2) seconds\n    set [laser v] to [0]\n    switch costume to (1 v)\n    wait (2) seconds\nend\nswitch costume to (2up v)\n\n