Dangerous District || Platformer 

Instructions: Instructions:\n  Use the arrow keys to control the player\n• Avoid spikes and lava.\n• Tap the up key while hovering over a jump ring to get a jump boost! \n• Tip: Holding down the up key will allow you to jump higher!

@Stage\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [Caves v] until done\nend\n\nwhen [m v] key pressed\nif <(volume) = [50]> then\n    set volume to (0) %\nelse\n    set volume to (50) %\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.75]\nset [resistance v] to [0.8]\nset [speed y v] to [0]\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 (smasher v)?> or <<touching (smasher2 v)?> or <touching (smasher3 v)?>>>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick player v]\nswitch backdrop to <touching (level 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 [101]\n        go to x: (-51) y: (2)\n    else\n        if <(CHECKPOINT#) = [2]> then\n            set [scene # v] to [2]\n            go to x: (-71) y: (-10)\n        else\n            if <(CHECKPOINT#) = [3]> then\n                set [scene # v] to [3]\n                go to x: (-77) y: (-44)\n            else\n                if <(CHECKPOINT#) = [4]> then\n                    set [scene # v] to [103]\n                    go to x: (-201) y: (8)\n                else\n                    if <(CHECKPOINT#) = [5]> then\n                        set [scene # v] to [6]\n                        go to x: (-208) y: (38)\n                    else\n                        if <(CHECKPOINT#) = [6]> then\n                            set [scene # v] to [7]\n                            go to x: (-210) y: (-12)\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 > then\n    start sound [Explode v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Restart and  Begin Level\n    broadcast (Next 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\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        start sound [Explode v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        Restart and  Begin Level\n        broadcast (Next 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\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\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@Lava\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)) ))\nend\n\n@Platform\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [1]> then\n    switch costume to (costume1 v)\n    show\n    Animate Platform\nend\nif <(SCENE #) = [101]> then\n    switch costume to (costume1 v)\n    show\n    Animate 2\nend\nif <(SCENE #) = [2]> then\n    switch costume to (costume1 v)\n    show\n    Animate 3\nend\nif <(SCENE #) = [5]> then\n    switch costume to (costume1 v)\n    show\n    Animate 4\nend\nif <(SCENE #) = [7]> then\n    switch costume to (costume1 v)\n    show\n    Animate 5\nend\n\ndefine Animate Platform\ngo to x: (157) y: (-16)\nforever\n    glide (1.5) secs to x: (157) y: (-96)\n    wait (1) seconds\n    glide (1.5) secs to x: (157) y: (-16)\n    wait (1) seconds\nend\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\ngo to x: (27) y: (-29)\nforever\n    glide (1.5) secs to x: (88) y: (59)\n    wait (1) seconds\n    glide (1.5) secs to x: (27) y: (-29)\n    wait (1) seconds\nend\n\nwhen I receive [next v]\nif <(SCENE #) = [1]> then\n    switch costume to (costume1 v)\n    show\n    Animate Platform\nend\nif <(SCENE #) = [101]> then\n    switch costume to (costume1 v)\n    show\n    Animate 2\nend\nif <(SCENE #) = [2]> then\n    switch costume to (costume1 v)\n    show\n    Animate 3\nend\nif <(SCENE #) = [5]> then\n    switch costume to (costume1 v)\n    show\nend\n\ndefine Animate 3\ngo to x: (2) y: (-40)\nforever\n    glide (1.5) secs to x: (140) y: (-40)\n    wait (1) seconds\n    glide (1.5) secs to x: (2) y: (-40)\n    wait (1) seconds\nend\n\ndefine Animate 4\nforever\n    go to x: (-142) y: (-48)\n    repeat (40)\n        change x by (3)\n    end\n    wait (1) seconds\n    repeat (39)\n        change y by (3)\n    end\n    wait (1) seconds\n    repeat (39)\n        change y by (-3)\n    end\n    wait (1) seconds\n    repeat (40)\n        change x by (-3)\n    end\n    wait (1) seconds\nend\n\nglide (1.5) secs to x: (140) y: (-40)\n\nglide (1.5) secs to x: (2) y: (-40)\n\nwhen flag clicked\nforever\n    if <not <<(SCENE #) = [1]> or <<(SCENE #) = [2]> or <<(SCENE #) = [5]> or <<(SCENE #) = [101]> or >>>>> then\n        hide\n    end\nend\n\ndefine Animate 5\ngo to x: (-53) y: (-43)\nforever\n    glide (2) secs to x: (155) y: (-43)\n    wait (1) seconds\n    glide (2) secs to x: (-53) y: (-43)\n    wait (1) seconds\nend\n\n@Checkpoint 1\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [101]> 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\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\n@Orbs\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 #) = [6]> then\n    Clone At X: [-133] [-26] At Size: [100]\nend\nif <(SCENE #) = [107]> then\n    Clone At X: [89] [-10] At Size: [100]\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo [backward v] (3) layers\nclear graphic effects\nforever\n    set size to ((([sin v] of (((timer) + ((0) * (400))) * (200)) ) * (12)) + (80)) %\nend\n\nbroadcast (Next v)\n\nwhen [m v] key pressed\nset [mouse v] to (join (join (mouse x) [ ]) (mouse y))\n\nwhen I receive [des v]\nstart sound [small v]\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\n@Checkpoint 2\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [2]> 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@Checkpoint 3\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#) = [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@Checkpoint 4\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [103]> then\n        show\n        go to x: (0) y: (0)\n        if <not <(CHECKPOINT#) = [4]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [4]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Smasher\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [3]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\n    if <not <(SCENE #) = [3]>> then\n        stop [other scripts in sprite v]\n    end\nend\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\ngo to x: (-69) y: (-19)\nforever\n    glide (2) secs to x: (60) y: (-19)\n    wait (1) seconds\n    glide (2) secs to x: (-69) y: (-19)\n    wait (1) seconds\nend\n\nwhen I receive [next v]\nif <(SCENE #) = [3]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\nend\n\ndefine Smash Animate\ngo to x: (50) y: (40)\nforever\n    glide (0.2) secs to x: (50) y: (-34)\n    start sound [Slam v]\n    wait (1) seconds\n    glide (3) secs to x: (50) y: (40)\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    if <not <(SCENE #) = [3]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [3]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\ndefine Smash 2\ngo to x: (50) y: (40)\nforever\n    glide (0.2) secs to x: (50) y: (-34)\n    start sound [Slam v]\n    wait (1) seconds\n    glide (3) secs to x: (50) y: (40)\n    wait (1) seconds\nend\n\n@Smasher2\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [103]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\n    if <not <(SCENE #) = [103]>> then\n        stop [other scripts in sprite v]\n    end\nend\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\ngo to x: (-69) y: (-19)\nforever\n    glide (2) secs to x: (60) y: (-19)\n    wait (1) seconds\n    glide (2) secs to x: (-69) y: (-19)\n    wait (1) seconds\nend\n\nwhen I receive [next v]\nif <(SCENE #) = [103]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\nend\n\ndefine Smash Animate\ngo to x: (50) y: (40)\nforever\n    glide (0.2) secs to x: (50) y: (-34)\n    start sound [Slam v]\n    wait (1) seconds\n    glide (3) secs to x: (50) y: (40)\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    if <not <(SCENE #) = [103]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [103]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\n@Checkpoint 5\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    if <(SCENE #) = [6]> then\n        show\n        go to x: (0) y: (0)\n        if <not <(CHECKPOINT#) = [5]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [5]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Checkpoint 6\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#) = [6]>> then\n            if <touching (player v)?> then\n                start sound [Flag v]\n                switch costume to (2 v)\n                set [checkpoint# v] to [6]\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Smasher3\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [6]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\n    if <not <(SCENE #) = [6]>> then\n        stop [other scripts in sprite v]\n    end\nend\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\nwhen I receive [next v]\nif <(SCENE #) = [6]> then\n    switch costume to (costume1 v)\n    show\n    Smash Animate\nend\n\ndefine Smash Animate\ngo to x: (50) y: (40)\nforever\n    glide (0.2) secs to x: (50) y: (-34)\n    start sound [Slam v]\n    wait (1) seconds\n    glide (3) secs to x: (50) y: (40)\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    if <not <(SCENE #) = [6]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [6]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\n