Platformer World v15.2

Instructions: This game is basically just Griffpatch's classic platformer but with more scenes, more enemy types, sawblades, drop through platforms, npcs, modes that changes the game, and much more\n\nv15.3 spoilers: ULTIMATE SCENE REDESIGNS\nCredits\nGriffpatch\nApet2385\nTheapplesguy2

@Stage\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nbroadcast (gomusic v)\nstop all sounds\nhide\n\nwhen I receive [change scene v]\nif <<(mode) = [DM]> or <(mode) = [CTM]>> then\n    switch backdrop to (cave v)\n    stop [this script v]\nend\nif <(SCENE #) = [-195]> then\n    switch backdrop to (scratchy's bedroom v)\n    stop [this script v]\nend\nif <<(SCENE #) < [-496]> and <(SCENE #) > [-701]>> then\n    switch backdrop to (cave v)\nelse\n    switch backdrop to (orange background v)\nend\n\nwhen I receive [gomusic v]\nif <(Music?) = [0]> then\n    stop [this script v]\nend\nif <(mode) = [CTM]> then\n    forever\n        play sound [Raldi's Crackhouse - Crackhouse Trouble! v] until done\n    end\nend\nif <(mode) = [TM]> then\n    forever\n        play sound [Mus_boss v] until done\n    end\nend\nif <(mode) = [DM]> then\n    forever\n        play sound [Yiruma+-+Kiss+the+Rain+이루마+PIANO+COVER v] until done\n    end\nend\nforever\n    play sound (pick random (2) to (15)) until done\nend\n\nwhen I receive [main menu v]\nstop [other scripts in sprite v]\nforever\n    play sound [Baldi Elevator Music v] until done\nend\n\nwhen I receive [you win! v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nset volume to (60) %\n\nwhen I receive [gomusic v]\nset [timer v] to [480]\nif <(mode) = [CTM]> then\n    set [timer v] to [360]\nend\nif <<(mode) = [CTM]> or <(mode) = [TM]>> then\n    show variable [timer v]\nelse\n    hide variable [timer v]\n    stop [this script v]\nend\nforever\n    wait (1) seconds\n    change [timer v] by (-1)\n    if <(Timer) < [1]> then\n        broadcast (Lose Life v)\n        set [lives v] to [0]\n    end\n    if <<(SCENE #) = [100]> or <(SCENE #) = [2612]>> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [timer v] to [480]\nhide variable [timer v]\n\nwhen I receive [20 seconds left warning v]\nrepeat until <<(Timer) > [10]> or <(Timer) < [1]>>\n    play sound [SFX - Time Warning2 v] until done\nend\n\nwhen I receive [gomusic v]\nforever\n    if <(Timer) < [10]> then\n        broadcast (20 seconds left warning v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\n\nwhen I receive [start game v]\nset [timer v] to [480]\nhide variable [timer v]\n\n@Player\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 - Celling or Floor\n    end\nend\n\ndefine Check Touching Solid\nif <<touching (drop through v)?> and <<<key (s v) pressed?> or <key (down arrow v) pressed?>> and <(jumping) = [0]>>> then\n    set [touching v] to [0]\n    stop [this script v]\nelse\n    set [touching v] to [1]\nend\nif <<<<touching (level v)?> or <touching (platform v)?>> or <<touching (platform2 v)?> or <touching (platform3 v)?>>> or <<<touching (falling platforms v)?> or <touching color (#00269a)?>> or <<touching (transparent blocks v)?> or <<touching (blocked v)?> or <touching (drop through v)?>>>>> then\n    set [touching v] to [1]\n    stop [this script v]\nend\nset [touching v] to [0]\nset [hit costume v] to (costume [name v])\nif <(hit costume) = [hitbox v2]> then\n    switch costume to (hitbox feet v)\nend\nif <touching (jump through v)?> then\n    if <(jump through) < [1]> then\n        change y by (-6)\n        if <(hit costume) = [hitbox v2]> then\n            switch costume to (hitbox feet2 v)\n        end\n        if <touching (jump through v)?> then\n            set [touching v] to [1]\n        else\n            set [jump through v] to [1]\n        end\n        change y by (6)\n    end\nelse\n    set [jump through v] to [0]\nend\nswitch costume to (hit costume)\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 - 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?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a 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    if <not <(direction) = ((KEY X) * (90))>> then\n        set [wall slide v] to [0]\n    end\n    point in direction ((KEY X) * (90))\n    if <touching (water v)?> then\n        change [frame v] by (0.7)\n    else\n        change [frame v] by (1)\n    end\nend\nif <touching (water v)?> then\n    set [speed x v] to ((speed x) * (WATER RESISTANCE))\n    stop [this script v]\nelse\n    set [speed x v] to ((speed x) * (RESISTANCE))\nend\n\ndefine Reset and Begin Level\nset [invulnerable v] to [0]\nset [speed y v] to [0]\nset [speed x 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]\npoint in direction (90)\nBegin Scene # (SPAWN SCENE) go to x,y (SPAWN X) (SPAWN Y)\n\nwhen I receive [game loop v]\nclear graphic effects\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Platforms v)\n    broadcast (Tick - Player v)\n    add (x position) to [my values to send v]\n    add (y position) to [my values to send v]\n    add (costume [number v]) to [my values to send v]\n    add (direction) to [my values to send v]\n    add (SCENE #) to [my values to send v]\n    broadcast (Cloud : Tick v)\n    broadcast (Tick - Last v)\nend\n\nwhen I receive [tick - last v]\ngo to [front v] layer\nif <(x position) > [235]> then\n    Begin Scene # ((SCENE #) + (1)) go to x,y [-235] []\nend\nif <(x position) < [-235]> then\n    Begin Scene # ((SCENE #) + (-1)) go to x,y [235] []\nend\nif <(y position) > [180]> then\n    Begin Scene # ((SCENE #) + (100)) go to x,y [] [-160]\nend\nif <(y position) < [-180]> then\n    Begin Scene # ((SCENE #) + (-100)) go to x,y [] [180]\nend\nif <<<<touching (danger v)?> or <touching (danger2 v)?>> or <touching (moving spikes v)?>> and <(INVULNERABLE) = [0]>> then\n    broadcast (Lose Life 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 (Exiting current scene v)\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 Collision in Direction [0]\nelse\n    Fix Collision in Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collision in Direction (direction)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (direction)\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 [0]\nset [platform dy v] to [0]\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.1))\nend\nset [speed x v] to ((speed x) * (0.95))\nSlip\n\ndefine Collide Y - Celling 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\nwhen I receive [lose life v]\nset [oof v] to [1]\nset [invulnerable v] to [1]\nstart sound [Oops v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(LIVES) > [0]> then\n    Reset and Begin Level\nelse\n    broadcast (Game over v)\nend\n\ndefine moved - by moving platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nchange x by (CONVEYOR DX)\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 Life 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        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    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\nFind closest space to (x position) (y position) max [100]\n\ndefine Controls - Up and Down\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <touching (water v)?> then\n        if <<(falling) > [0]> or <(falling) = [0]>> then\n            set [speed y v] to [5]\n            if <not <touching (water v)?>> then\n                set [speed y v] to [10]\n            end\n            stop [this script v]\n        end\n    end\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n        start sound [wall jump v]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [7]\n    end\n    if <<(falling) < [3]> and <(jumping) = [0]>> then\n        start sound [jump v]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\nelse\n    set [jumping v] to [0]\nend\nif <<(jumping) > [0]> and <(jumping) < (JUMP DURATION)>> then\n    change [jumping v] by (1)\n    set [speed y v] to (JUMP FORCE)\nend\nchange [speed y v] by (GRAVITY)\nif <<touching (water v)?> and <(speed y) < [2]>> then\n    set [speed y v] to ((speed y) * (WATER RESISTANCE))\nend\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\nwhen flag clicked\nbroadcast (Cloud : Setup v) and wait\nbroadcast (Main Menu v)\n\nwhen I receive [start game v]\nshow\nset size to (40) %\nset [gravity v] to [-1.2]\nif <(mode) = [TM]> then\n    set [acceleration v] to [3]\nelse\n    if <(mode) = [CTM]> then\n        set [acceleration v] to [4.5]\n    else\n        set [acceleration v] to [1.5]\n    end\nend\nset [jump force v] to [13.5]\nset [jump duration v] to [4]\nset [acceleration v] to [1.5]\nset [water resistance v] to [0.7]\nbroadcast (reset game v) and wait\nbroadcast (Setup v) and wait\nset [oof v] to [0]\nset [lives v] to [22]\nset [spawn scene v] to [0]\nset [spawn x v] to [-106]\nset [spawn y v] to [70]\nReset and Begin Level\n\nwhen I receive [player - bounce v]\nset [speed y v] to [10]\n\nwhen I receive [player bounce higher v]\nset [speed y v] to [25]\n\nwhen I receive [trampoline v]\nset [speed y v] to [25]\n\nwhen I receive [trampoline2 v]\nset [speed x v] to [40]\nset [speed y v] to [5]\n\nwhen I receive [exit v]\nrepeat (50)\n    stop [other scripts in sprite v]\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\nshow\nerase all\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [scene # v] to [68]\ngo to x: (-198) y: (50)\nbroadcast (Game Loop v)\nbroadcast (Change Scene v)\nset size to (40) %\n\nwhen I receive [you win! v]\nrepeat (50)\n    stop [other scripts in sprite v]\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\nbroadcast (Win Screen v)\n\nwhen I receive [player hit boss v]\nset [speed y v] to [20]\n\nwhen I receive [teleportation v]\nstop [other scripts in sprite v]\nif <<(SCENE #) = [308]> or <(SCENE #) = [416]>> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    go to [back v] layer\n    wait (2) seconds\n    if <(SCENE #) = [416]> then\n        set [scene # v] to [308]\n    else\n        set [scene # v] to [416]\n    end\n    broadcast (Exiting current scene v)\n    broadcast (Change Scene v)\n    if <(SCENE #) = [308]> then\n        go to x: (79) y: (36)\n    else\n        go to x: (55) y: (-135)\n    end\n    broadcast (stamp them v)\n    wait (0.5) seconds\n    broadcast (open door v)\n    wait (2) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    go to [front v] layer\n    broadcast (Game Loop v)\nend\n\nwhen I receive [stop player from moving v]\nstop [other scripts in sprite v]\n\n@Level\n\ndefine Stamp shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\nStamp shadow\nStamp outline\n\nwhen flag clicked\nclear graphic effects\nwait (0.5) seconds\ngo to x: (0) y: (0)\n\nwhen I receive [exiting current scene v]\nerase all\n\nset [scene # v] to [418]\n\nwhen I receive [rm v]\nforever\n    change [color v] effect by (2)\nend\n\nwhen I receive [nm v]\nclear graphic effects\n\n@Platform\n\ndefine Door at (x) (y) key (key name)\npoint in direction (90)\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 [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [-261]> then\n    point in direction (0)\n    switch costume to (squisher \(big boy\) v)\n    show\n    HWEEJE9D\nend\nif <(SCENE #) = [320]> then\n    switch costume to (big plank2 v)\n    show\n    LOOOOOOOOOOOOOP\nend\nif <(SCENE #) = [1705]> then\n    point in direction (0)\n    switch costume to (squisher \(big boy\) v)\n    show\n    Animate SUPER\nend\nif <(SCENE #) = [307]> then\n    switch costume to (repeating platforms v)\n    show\n    Animate Loop2\nend\nif <(SCENE #) = [37]> then\n    switch costume to (repeating platforms v)\n    show\n    Animate Loop\nend\nif <(SCENE #) = [219]> then\n    switch costume to (light blue platform v)\n    show\n    Animate 701XS\nend\nif <(SCENE #) = [-200]> then\n    switch costume to (platform \(diagonal\) v)\n    show\n    Animate smooth diagonal\nend\nif <(SCENE #) = [329]> then\n    switch costume to (platform \(mixed\) v)\n    show\n    Animate 32T\nend\nif <(SCENE #) = [40]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate smooth 2\nend\nif <(SCENE #) = [-203]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    animate smooth\nend\nif <(SCENE #) = [-96]> then\n    switch costume to (squisher v)\n    show\n    Animate-96\nend\nif <(SCENE #) = [-4]> then\n    switch costume to (platform \(vertical\) v)\n    show\n    Animate -4\nend\nif <(SCENE #) = [415]> then\n    switch costume to (big plank v)\n    show\n    Animate Big\nend\nif <(SCENE #) = [-102]> then\n    switch costume to (platform \(mixed\)3 v)\n    show\n    Animate Tri\nend\nif <(SCENE #) = [1]> then\n    switch costume to (platform \(mixed\)2 v)\n    show\n    Animate Platform\nend\nif <(SCENE #) = [102]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate 3\nend\nif <(SCENE #) = [132]> then\n    switch costume to (platform \(mixed\)2 v)\n    show\n    animate mixed\nend\nif <(SCENE #) = [3]> then\n    point in direction (0)\n    switch costume to (squisher v)\n    show\n    Animate [99] [28] [99] [-26] [2] [0.5] spawn x [99] spawn y [-24]\nend\nif <(SCENE #) = [5]> then\n    point in direction (90)\n    switch costume to (key 2 v)\n    Door at [-163] [-104] key [Key 2]\nend\nif <(SCENE #) = [20]> then\n    switch costume to (platform \(diagonal\) v)\n    show\n    animate 6\nend\nif <(SCENE #) = [25]> then\n    switch costume to (platform \(mixed\)3 v)\n    show\n    Animate mixed 3\nend\nif <(SCENE #) = [221]> then\n    switch costume to (platform \(vertical\) v)\n    show\n    Animate221\nend\nif <(SCENE #) = [28]> then\n    switch costume to (platform \(vertical\) v)\n    show\n    Animate 7\nend\nif <(SCENE #) = [31]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate special\nend\nif <(SCENE #) = [35]> then\n    switch costume to (squisher \(big boy\) v)\n    show\n    ANIMATE DA BIG BOY\nend\nif <(SCENE #) = [228]> then\n    switch costume to (close n open v)\n    show\n    animate42\nend\nif <(SCENE #) = [202]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate202\nend\nif <(SCENE #) = [251]> then\n    switch costume to (platform \(mixed\) v)\n    show\n    Animate251\nend\nif <(SCENE #) = [308]> then\n    switch costume to (moving gate v)\n    show\n    Animate 4\nend\nif <(SCENE #) = [1706]> then\n    switch costume to (platform \(diagonal\) v)\n    show\n    Animate troll\nend\n\ndefine Animate Platform\ngo to x: (52) y: (-56)\npoint in direction (90)\nforever\n    glide (2) secs to x: (52) y: (65)\n    wait (0.8) seconds\n    glide (2) secs to x: (133) y: (7)\n    wait (0.8) seconds\n    glide (2) secs to x: (52) y: (-57)\n    wait (0.8) seconds\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [platform: last x v] to (x position)\nset [platform: last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(new y) > (Platform: last y)> then\n    change y by (1)\nelse\n    set y to ((Platform: last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to (((new x) - (Platform: last x)) * (DX cancel))\n    set [platform dy v] to (((new y) - (Platform: last y)) * (DY cancel))\n    set [dx cancel v] to [1]\n    set [dy cancel v] to [1]\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate 3\ngo to x: (85) y: (-48)\npoint in direction (90)\nforever\n    glide (2) secs to x: (-64) y: (-48)\n    wait (1) seconds\n    glide (2) secs to x: (85) y: (-48)\n    wait (1) seconds\nend\n\ndefine Animate 4\ngo to x: (-122) y: (-34)\npoint in direction (0)\nforever\n    glide (0.9) secs to x: (-122) y: (-126)\n    wait (1) seconds\n    glide (3) secs to x: (-122) y: (-34)\n    wait (1) seconds\nend\n\ndefine animate 6\npoint in direction (90)\ngo to x: (-93) y: (-75)\nforever\n    glide (4) secs to x: (146) y: (-20)\n    wait (1) seconds\n    glide (4) secs to x: (-93) y: (-75)\n    wait (1) seconds\nend\n\ndefine Animate 7\ngo to x: (179) y: (-101)\npoint in direction (90)\nforever\n    glide (3) secs to x: (179) y: (60)\n    wait (1) seconds\n    glide (3) secs to x: (179) y: (-101)\n    wait (1) seconds\nend\n\ndefine Animate special\ngo to x: (-119) y: (60)\npoint in direction (90)\nwait (3) seconds\nforever\n    glide (4) secs to x: (121) y: (60)\n    wait (1) seconds\n    glide (4) secs to x: (-119) y: (60)\n    wait (1) seconds\nend\n\ndefine ANIMATE DA BIG BOY\ngo to x: (-54) y: (-120)\npoint in direction (180)\nforever\n    glide (4) secs to x: (-54) y: (-439)\n    wait (1) seconds\n    glide (2) secs to x: (-54) y: (-120)\n    start sound [Crunch v]\n    wait (1) seconds\nend\n\ndefine animate42\npoint in direction (90)\ngo to x: (-118) y: (12)\nforever\n    glide (5) secs to x: (118) y: (12)\n    wait (1) seconds\n    glide (5) secs to x: (-118) y: (12)\n    wait (1) seconds\nend\n\ndefine animate mixed\npoint in direction (90)\ngo to x: (-113) y: (-7)\nforever\n    glide (3) secs to x: (154) y: (-31)\n    wait (1) seconds\n    glide (3) secs to x: (-113) y: (-80)\n    wait (1) seconds\n    glide (2) secs to x: (-113) y: (-7)\n    wait (1) seconds\nend\n\ndefine Animate Tri\npoint in direction (90)\ngo to x: (102) y: (-77)\nforever\n    glide (3) secs to x: (-65) y: (-77)\n    wait (1) seconds\n    glide (3) secs to x: (21) y: (77)\n    wait (1) seconds\n    glide (3) secs to x: (102) y: (-77)\n    wait (1) seconds\nend\n\ndefine Animate troll\npoint in direction (90)\ngo to x: (179) y: (50)\nforever\n    glide (0.6) secs to x: (-5) y: (-6)\n    wait (1) seconds\n    glide (0.6) secs to x: (179) y: (50)\n    wait (1) seconds\nend\n\ndefine Animate mixed 3\npoint in direction (90)\ngo to x: (-155) y: (11)\nforever\n    glide (2) secs to x: (22) y: (11)\n    glide (2) secs to x: (171) y: (-21)\n    wait (1) seconds\n    glide (2) secs to x: (22) y: (11)\n    glide (2) secs to x: (-155) y: (11)\n    wait (1) seconds\nend\n\ndefine Animate221\npoint in direction (90)\ngo to x: (-86) y: (-71)\nwait (1) seconds\nforever\n    glide (3) secs to x: (-86) y: (85)\n    wait (1) seconds\n    glide (3) secs to x: (-86) y: (-71)\n    wait (1) seconds\nend\n\ndefine Animate251\npoint in direction (90)\ngo to x: (-75) y: (109)\nwait (1) seconds\nforever\n    glide (3) secs to x: (-75) y: (-122)\n    wait (1) seconds\n    glide (3) secs to x: (55) y: (-122)\n    wait (1) seconds\n    glide (3) secs to x: (55) y: (109)\n    wait (1) seconds\n    glide (3) secs to x: (55) y: (-122)\n    wait (1) seconds\n    glide (3) secs to x: (-75) y: (-122)\n    wait (1) seconds\n    glide (3) secs to x: (-75) y: (109)\n    wait (1) seconds\nend\n\ndefine Animate202\npoint in direction (90)\ngo to x: (38) y: (-48)\nforever\n    glide (4) secs to x: (-130) y: (-48)\n    wait (1) seconds\n    glide (4) secs to x: (38) y: (-48)\n    wait (1) seconds\nend\n\ndefine Animate Big\npoint in direction (90)\ngo to x: (-257) y: (-45)\nwait (1) seconds\nforever\n    repeat until <(x position) > [229]>\n        change x by (2)\n    end\n    set [dx cancel v] to [0]\n    set x to (-257)\nend\n\ndefine Animate -4\npoint in direction (90)\ngo to x: (-45) y: (-116)\nforever\n    glide (4) secs to x: (-45) y: (48)\n    wait (1) seconds\n    glide (4) secs to x: (-45) y: (-116)\n    wait (1) seconds\nend\n\ndefine Animate-96\npoint in direction (0)\ngo to x: (1) y: (99)\nforever\n    glide (0.5) secs to x: (1) y: (27)\n    wait (0.5) seconds\n    glide (2) secs to x: (1) y: (99)\n    wait (1) seconds\nend\n\ndefine animate smooth\ngo to x: (0) y: (55)\npoint in direction (90)\nforever\n    set x to (([sin v] of ((timer) * (50)) ) * (91))\nend\n\ndefine Animate smooth 2\ngo to x: (130) y: (55)\npoint in direction (90)\nforever\n    set x to (([sin v] of ((timer) * (100)) ) * (130))\nend\n\ndefine Animate smooth diagonal\ngo to x: (0) y: (55)\npoint in direction (90)\nforever\n    set y to (([sin v] of ((timer) * (50)) ) * (50))\n    set x to (([sin v] of ((timer) * (50)) ) * (130))\nend\n\ndefine Animate 32T\npoint in direction (90)\ngo to x: (-142) y: (65)\nforever\n    glide (1.5) secs to x: (-142) y: (-19)\n    wait (1) seconds\n    glide (3) secs to x: (89) y: (-19)\n    wait (1) seconds\n    glide (3) secs to x: (-142) y: (-19)\n    wait (1) seconds\n    glide (1.5) secs to x: (-142) y: (65)\n    wait (1) seconds\nend\n\ndefine Animate (x) (y) (x2) (y2) (time) (time2) spawn x (spawn x) spawn y (spawn y)\ngo to x: (spawn x) y: (spawn y)\nforever\n    glide (time) secs to x: (x) y: (y)\n    wait (1) seconds\n    glide (time2) secs to x: (x2) y: (y2)\n    wait (1) seconds\nend\n\ndefine Animate 701XS\npoint in direction (90)\ngo to x: (-102) y: (-55)\nforever\n    glide (1) secs to x: (-102) y: (0)\n    glide (1) secs to x: (-102) y: (-55)\nend\n\ndefine Animate Loop\npoint in direction (90)\nif <([x position v] of [player v]) > [0]> then\n    go to x: (128) y: (64)\n    forever\n        repeat (56)\n            change y by (-2)\n        end\n        set [dy cancel v] to [0]\n        set y to (64)\n    end\nelse\n    go to x: (128) y: (-64)\n    forever\n        repeat (56)\n            change y by (2)\n        end\n        set [dy cancel v] to [0]\n        set y to (-64)\n    end\nend\n\ndefine Animate Loop2\npoint in direction (90)\ngo to x: (162) y: (64)\nforever\n    repeat (56)\n        change y by (-2)\n    end\n    set [dy cancel v] to [0]\n    set y to (64)\nend\n\ndefine Animate SUPER\nset [speed y v] to [0]\ngo to x: (-47) y: (406)\nforever\n    point in direction (0)\n    repeat until <(y position) < [166]>\n        change [speed y v] by (-1)\n        change y by (speed y)\n    end\n    start sound [Crunch v]\n    set [speed y v] to [0]\n    glide (2) secs to x: (-47) y: (406)\nend\n\ndefine LOOOOOOOOOOOOOP\ngo to [back v] layer\npoint in direction (90)\ngo to x: (-111) y: (-208)\nforever\n    repeat (282)\n        change y by (2)\n        go to [back v] layer\n    end\n    go to [back v] layer\n    set [dy cancel v] to [0]\n    set y to (-208)\nend\n\ndefine HWEEJE9D\nset [speed y v] to [0]\ngo to x: (-88) y: (406)\nforever\n    point in direction (0)\n    repeat until <(y position) < [172]>\n        change [speed y v] by (-1)\n        change y by (speed y)\n    end\n    start sound [Crunch v]\n    set [speed y v] to [0]\n    glide (2) secs to x: (-88) y: (406)\nend\n\n@Danger\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\ngo to [back v] layer\ngo [forward v] (1) layers\nif <<<<<(SCENE #) = [215]> or <<(SCENE #) = [332]> or <<(SCENE #) = [112]> or <<(SCENE #) = [315]> or <<(SCENE #) = [333]> or <<(SCENE #) = [320]> or <(SCENE #) = [1202]>>>>>>> or <<(SCENE #) = [-359]> or <<(SCENE #) = [322]> or <(SCENE #) = [106]>>>> or <(SCENE #) = [-362]>> or <<<(SCENE #) = [21]> or <(SCENE #) = [25]>> or <<(SCENE #) = [26]> or <<<(SCENE #) = [20]> or <(SCENE #) = [14]>> or <<(SCENE #) = [13]> or <<<(SCENE #) = [28]> or <<(SCENE #) = [29]> or <<(SCENE #) = [27]> or <<<<(SCENE #) = [-3]> or <(SCENE #) = [3]>> or <<<(SCENE #) = [6]> or <(SCENE #) = [202]>> or <(SCENE #) = [210]>>> or <<<<(SCENE #) = [-498]> or <(SCENE #) = [-599]>> or <<(SCENE #) = [-92]> or <(SCENE #) = [-86]>>> or <<(SCENE #) = [219]> or <(SCENE #) = [-266]>>>>>>> or <<<(SCENE #) = [803]> or <<(SCENE #) = [802]> or <<<(SCENE #) = [804]> or <(SCENE #) = [1302]>> or <<(SCENE #) = [2512]> or <<<(SCENE #) = [1505]> or <(SCENE #) = [1303]>> or <<(SCENE #) = [1606]> or <(SCENE #) = [1405]>>>>>>> or <<(SCENE #) = [38]> or <<<(SCENE #) = [209]> or <(SCENE #) = [74]>> or <<<<(SCENE #) = [89]> or <(SCENE #) = [31]>> or <<(SCENE #) = [67]> or <(SCENE #) = [46]>>> or <<<(SCENE #) = [71]> or <(SCENE #) = [65]>> or <<<<<(SCENE #) = [304]> or <(SCENE #) = [235]>> or <<(SCENE #) = [306]> or <(SCENE #) = [232]>>> or <<<(SCENE #) = [408]> or <(SCENE #) = [314]>> or <<(SCENE #) = [603]> or <(SCENE #) = [605]>>>> or <<<(SCENE #) = [132]> or <(SCENE #) = [127]>> or <<<(SCENE #) = [120]> or <(SCENE #) = [118]>> or <<<(SCENE #) = [130]> or <(SCENE #) = [129]>> or <<(SCENE #) = [329]> or <(SCENE #) = [102]>>>>>>>>>>>>>>>>> then\n    forever\n        show\n        go to [back v] layer\n        set y to ((3) * ([sin v] of ((timer) * (380)) ))\n    end\nend\n\n@Danger2\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nif <(mode) = [HM]> then\n    show\nelse\n    hide\nend\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <(SCENE #) = [131]> then\n    forever\n        go to [back v] layer\n        set y to ((3) * ([sin v] of ((timer) * (380)) ))\n    end\nend\n\n@Platform2\n\ndefine Door at (x) (y) key (key name)\npoint in direction (90)\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 [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [platform: last x v] to (x position)\nset [platform: last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(new y) > (Platform: last y)> then\n    change y by (1)\nelse\n    set y to ((Platform: last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (Platform: last x))\n    set [platform dy v] to ((new y) - (Platform: last y))\nend\ngo to x: (new x) y: (new y)\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [1202]> then\n    switch costume to (10 v)\n    show\n    Door at [-13] [108] Apples [10]\nend\nif <(SCENE #) = [205]> then\n    switch costume to (6 v)\n    show\n    Door at [-152] [4] Apples [6]\nend\nif <(SCENE #) = [509]> then\n    switch costume to (key 35s v)\n    show\n    Door at [145] [-61] key [Key 35S]\nend\nif <(SCENE #) = [-261]> then\n    point in direction (0)\n    switch costume to (squisher \(big boy\) v)\n    show\n    E\nend\nif <(SCENE #) = [-194]> then\n    switch costume to (key 21a v)\n    show\n    Door at [-143] [65] key [Key 21A]\nend\nif <(SCENE #) = [320]> then\n    go to [back v] layer\n    switch costume to (big planks v)\n    show\n    LOOOOOOP\nend\nif <(SCENE #) = [219]> then\n    switch costume to (darker blue platform v)\n    show\n    Animate 219-2\nend\nif <(SCENE #) = [-166]> then\n    switch costume to (passport v)\n    show\n    Door at [85] [108] key [Passport]\nend\nif <(SCENE #) = [40]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate smooth\nend\nif <(SCENE #) = [-396]> then\n    switch costume to (key 6 v)\n    show\n    Door at [-79] [-24] key [Key 6]\nend\nif <(SCENE #) = [-100]> then\n    switch costume to (key 1 v)\n    show\n    Door at [160] [39] key [Key 1]\nend\nif <(SCENE #) = [221]> then\n    switch costume to (key 1 v)\n    show\n    Door at [-144] [-38] key [Key 1]\nend\nif <(SCENE #) = [310]> then\n    switch costume to (key 7 v)\n    show\n    Door at [-88] [-113] key [Key 7]\nend\nif <(SCENE #) = [65]> then\n    switch costume to (platform \(diagonal\) v)\n    show\n    Animate 12.5\nend\nif <(SCENE #) = [99]> then\n    Door at [159] [-46] key [Key 9]\nend\nif <(SCENE #) = [200]> then\n    Door at [-66] [-93] key [Key 10]\nend\nif <(SCENE #) = [235]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    animate 13.45\nend\nif <(SCENE #) = [1201]> then\n    Door at [-78] [104] key [Key 3]\nend\nif <(SCENE #) = [2512]> then\n    switch costume to (platform \(horizontal\) v)\n    show\n    Animate2512\nend\n\ndefine Hi\ngo to x: (56) y: (63)\nforever\n    glide (4) secs to x: (-146) y: (63)\n    wait (1) seconds\n    glide (4) secs to x: (56) y: (63)\n    wait (1) seconds\nend\n\ndefine Animate 12.5\ngo to x: (-47) y: (8)\nwait (4) seconds\nforever\n    glide (4) secs to x: (146) y: (-85)\n    wait (1) seconds\n    glide (4) secs to x: (-47) y: (8)\n    wait (1) seconds\nend\n\ndefine animate 13.45\ngo to x: (-85) y: (-31)\npoint in direction (90)\nforever\n    glide (3) secs to x: (83) y: (-31)\n    wait (1) seconds\n    glide (3) secs to x: (-85) y: (-31)\n    wait (1) seconds\nend\n\ndefine Animate2512\ngo to x: (-37) y: (75)\nforever\n    glide (2) secs to x: (121) y: (75)\n    wait (1) seconds\n    glide (2) secs to x: (-37) y: (75)\n    wait (1) seconds\nend\n\ndefine Animate smooth\ngo to x: (-130) y: (55)\nforever\n    set x to (([sin v] of ((timer) * (100)) ) * (-130))\nend\n\ndefine Animate 219-2\ngo to x: (93) y: (-55)\nforever\n    glide (0.9) secs to x: (93) y: (0)\n    glide (0.9) secs to x: (93) y: (-55)\nend\n\ndefine Door at (x) (y) Apples (value)\npoint in direction (90)\nshow\nswitch costume to (value)\nset [targetted apples v] to (costume [name v])\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <(APPLES) > ((targetted apples) - (1))> then\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\ndefine LOOOOOOP\npoint in direction (90)\ngo to x: (-5) y: (208)\nforever\n    repeat (282)\n        change y by (-2)\n        go to [back v] layer\n    end\n    go to [back v] layer\n    set [dy cancel v] to [0]\n    set y to (208)\nend\n\ndefine E\nset [speed y v] to [0]\ngo to x: (120) y: (166)\nforever\n    glide (2) secs to x: (120) y: (406)\n    point in direction (0)\n    repeat until <(y position) < [172]>\n        change [speed y v] by (-1)\n        change y by (speed y)\n    end\n    start sound [Crunch v]\n    set [speed y v] to [0]\nend\n\n@Collectable\n\nwhen I receive [change scene v]\nif <(SCENE #) = (Collectable: my scene)> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setup v]\nshow variable [apples v]\ndelete all of [collected v]\nset [apples v] to [0]\nset [frame v] to [0]\nset [coin v] to [0]\nhide\nPlace [apple3] scene [-260] xy [83] [-70]\nPlace [Light Grey Flag] scene [-259] xy [46] [-74]\nPlace [Key 35S] scene [609] xy [113] [58]\nPlace [apple2] scene [1705] xy [-160] [98]\nPlace [Key 21A] scene [-197] xy [69] [69]\nPlace [Passport] scene [-196] xy [2] [-41]\nPlace [apple5] scene [-192] xy [176] [-95]\nPlace [Black Flag] scene [284] xy [-127] [-87]\nPlace [apple3] scene [-700] xy [85] [11]\nPlace [Key 6] scene [-295] xy [-46] [-14]\nPlace [apple] scene [-100] xy [166] [-84]\nPlace [apple2] scene [-94] xy [-162] [100]\nPlace [apple2] scene [-3] xy [-150] [101]\nPlace [apple] scene [0] xy [77] [-56]\nPlace [apple] scene [0] xy [115] [-56]\nPlace [Key 1] scene [0] xy [118] [38]\nPlace [apple] scene [1] xy [-171] [141]\nPlace [Green Flag] scene [2] xy [171] [15]\nPlace [Key 2] scene [4] xy [-216] [30]\nPlace [Red Flag2] scene [11] xy [52] [40]\nPlace [Yellow Flag] scene [20] xy [-182] [40]\nPlace [Blue flag] scene [30] xy [-179] [94]\nPlace [Green-yellow flag] scene [57] xy [-154] [-121]\nPlace [apple] scene [58] xy [-93] [-13]\nPlace [apple] scene [58] xy [-51] [17]\nPlace [apple] scene [58] xy [-96] [64]\nPlace [apple] scene [58] xy [-21] [-12]\nPlace [White Flag] scene [68] xy [10] [-20]\nPlace [Lives] scene [69] xy [109] [-85]\nPlace [apple] scene [100] xy [-89] [-108]\nPlace [apple2] scene [100] xy [-45] [-108]\nPlace [apple3] scene [100] xy [-2] [-108]\nPlace [Orange] scene [100] xy [41] [-108]\nPlace [apple] scene [101] xy [-9] [-18]\nPlace [bananas] scene [102] xy [-146] [-18]\nPlace [bananas] scene [103] xy [-167] [46]\nPlace [bananas] scene [103] xy [195] [-37]\nPlace [Orange] scene [109] xy [-169] [116]\nPlace [Key 10] scene [198] xy [-122] [134]\nPlace [Key 9] scene [200] xy [134] [109]\nPlace [apple2] scene [203] xy [-83] [64]\nPlace [Orange] scene [242] xy [-176] [21]\nPlace [apple2] scene [606] xy [176] [0]\nPlace [apple2] scene [804] xy [157] [92]\nPlace [apple2] scene [-199] xy [29] [-27]\nPlace [Purple flag] scene [201] xy [10] [-4]\nPlace [Red Flag] scene [213] xy [-130] [-10]\nPlace [Orange] scene [222] xy [-206] [36]\nPlace [Strange Flag] scene [225] xy [13] [59]\nPlace [apple3] scene [245] xy [76] [-93]\nPlace [Passport] scene [260] xy [-162] [-87]\nPlace [Key 7] scene [307] xy [-137] [89]\nPlace [Key 3] scene [1100] xy [37] [-24]\nPlace [apple4] scene [1204] xy [144] [-82]\nPlace [Pink Flag] scene [1302] xy [30] [-48]\nPlace [Light Blue Flag] scene [-266] xy [113] [124]\n\ndefine Place (costume name) scene (scene) xy (x) (y)\nset [collectable: my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [collectable: my scene v] to []\n\nwhen I receive [reset game v]\ndelete this clone\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\nif < (mode) contains [TM]?> then\n    change [timer v] by (1)\nend\nset [collectable: my scene v] to []\nif <(costume [name v]) = [apple]> then\n    start sound [Chomp v]\n    change [apples v] by (1)\nelse\n    if <<(costume [name v]) = [Orange]> or <(costume [name v]) = [bananas]>> then\n        start sound [Chomp v]\n    else\n        if < (costume [name v]) contains [apple2]?> then\n            start sound [Wand v]\n            change [apples v] by (5)\n        else\n            if < (costume [name v]) contains [apple3]?> then\n                start sound [Wand v]\n                change [apples v] by (25)\n            else\n                if < (costume [name v]) contains [apple4]?> then\n                    start sound [Wand v]\n                    change [apples v] by (100)\n                else\n                    if < (costume [name v]) contains [The Goal]?> then\n                        start sound [SFX - Celebration v]\n                    else\n                        if << (costume [name v]) contains [Flag]?> or < (costume [name v]) contains [flag]?>> then\n                            start sound [Flag v]\n                            set [spawn scene v] to (SCENE #)\n                            set [spawn x v] to ([x position v] of [player v])\n                            set [spawn y v] to ([y position v] of [player v])\n                        else\n                            if <(costume [name v]) = [Lives]> then\n                                start sound [Wand v]\n                                change [lives v] by (5)\n                            else\n                                if < (costume [name v]) contains [apple5]?> then\n                                    start sound [Wand v]\n                                    change [apples v] by (25)\n                                else\n                                    start sound [Key v]\n                                    add (costume [name v]) to [collected v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\n@Splash Screen\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (main menu1 v)\ngo to [front v] layer\nshow\n\nwhen I receive [game over v]\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (game over v)\ngo to [front v] layer\nshow\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [win screen v]\nbroadcast (Button v)\nswitch costume to (win screen v)\nshow\nplay sound [SFX - Celebration v] until done\n\nwhen I receive [settings v]\nswitch costume to (settings v)\nstop [other scripts in sprite v]\n\nwhen flag clicked\nwait until <key (enter v) pressed?>\nstart sound [coin 2 v]\nbroadcast (Settings2 v)\n\nwhen I receive [settings2 v]\nswitch costume to (settings2 v)\nstop [other scripts in sprite v]\n\nwhen I receive [announcements v]\nswitch costume to (announcements v)\n\n@Main Menu\n\nwhen flag clicked\nset [hide? v] to [false]\nhide\n\nwhen this sprite clicked\nif <(costume [name v]) = [Play]> then\n    start sound [coin 2 v]\n    hide\n    set [hide? v] to [true]\n    broadcast (Settings v)\nelse\n    start sound [coin 2 v]\n    hide\n    set [hide? v] to [true]\n    broadcast (Announcements v)\nend\n\nwhen I receive [main menu v]\nset size to (10) %\nswitch costume to (play v)\nwait (0.001) seconds\ngo to [front v] layer\nshow\ngo to x: (132) y: (-17)\nrepeat (30)\n    change size by (((100) - (size)) / (5))\nend\nforever\n    if <(can click?) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((135) - (size)) / (5))\n        else\n            change size by (((100) - (size)) / (5))\n        end\n    end\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\nbroadcast (Button2 v)\nstop all sounds\nstart sound [Candy Crush Intro2 v]\nset [hide? v] to [false]\nswitch costume to (retry v)\nwait (0.1) seconds\ngo to [front v] layer\nshow\ngo to x: (0) y: (-65)\nset size to (10) %\nrepeat (30)\n    change size by (((100) - (size)) / (5))\nend\nforever\n    if <(can click?) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((150) - (size)) / (5))\n        else\n            change size by (((100) - (size)) / (5))\n        end\n    end\nend\n\nwhen I receive [main menu v]\nforever\n    if <(hide?) = [true]> then\n        stop [this script v]\n    end\n    if <touching (mouse-pointer v)?> then\n        start sound [click v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [button2 v]\nwait (1) seconds\nforever\n    if <(hide?) = [true]> then\n        stop [this script v]\n    end\n    if <touching (mouse-pointer v)?> then\n        start sound [click v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [button v]\nset [hide? v] to [false]\nshow\nswitch costume to (play again v)\ngo to [front v] layer\ngo to x: (0) y: (-65)\n\nwhen I receive [button v]\nwait (1) seconds\nforever\n    if <(hide?) = [true]> then\n        stop [this script v]\n    end\n    if <touching (mouse-pointer v)?> then\n        start sound [click v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [more settings v]\nset [hide? v] to [true]\nhide\n\nwhen I receive [settings2 v]\nset [hide? v] to [true]\nhide\n\nwhen I receive [button3 v]\nwait (1) seconds\nforever\n    if <(hide?) = [true]> then\n        stop [this script v]\n    end\n    if <touching (mouse-pointer v)?> then\n        start sound [click v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [announcements v]\nhide\n\n@Enemy\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\n\nwhen I receive [change scene v]\nif <not <(mode) = [CTM]>> then\n    if <(SCENE #) = [509]> then\n        Spawn [Green] at [36] [-89] dir [-90]\n    end\n    if <(SCENE #) = [-360]> then\n        Spawn [Grey] at [-50] [-136] dir [90]\n    end\n    if <(SCENE #) = [1402]> then\n        Spawn [Grey] at [111] [-112] dir [-90]\n    end\n    if <(SCENE #) = [215]> then\n        Spawn [Orange] at [-109] [52] dir [-90]\n    end\n    if <(SCENE #) = [-361]> then\n        Spawn [White] at [106] [-84] dir [-90]\n    end\n    if <(SCENE #) = [42]> then\n        Spawn [Red] at [159] [-125] dir [-90]\n    end\n    if <(SCENE #) = [214]> then\n        Spawn [Red] at [-109] [-91] dir [-90]\n        Spawn [Cyan] at [-81] [-91] dir [90]\n        Spawn [Blue] at [88] [-91] dir [90]\n        Spawn [Yellow] at [27] [-91] dir [-90]\n        Spawn [Pink] at [27] [84] dir [-90]\n    end\n    if <(SCENE #) = [37]> then\n        Spawn [Red] at [-154] [47] dir [90]\n        Spawn [Cyan] at [20] [5] dir [-90]\n        Spawn [Light Pink] at [-106] [-59] dir [-90]\n    end\n    if <(SCENE #) = [328]> then\n        Spawn [Red] at [-34] [-89] dir [-90]\n        Spawn [Blue] at [97] [14] dir [-90]\n        Spawn [Red] at [48] [-89] dir [-90]\n    end\n    if <(SCENE #) = [183]> then\n        Spawn [Light Pink] at [140] [-125] dir [-90]\n    end\n    if <(SCENE #) = [284]> then\n        Spawn [Red] at [176] [-16] dir [-90]\n        Spawn [Blue] at [115] [-28] dir [90]\n    end\n    if <(SCENE #) = [-98]> then\n        Spawn [Pink] at [-60] [-102] dir [-90]\n        Spawn [Blue] at [-45] [-102] dir [-90]\n        Spawn [Pink] at [-13] [-102] dir [-90]\n        Spawn [Blue] at [19] [-102] dir [-90]\n        Spawn [Cyan] at [12] [-102] dir [-90]\n        Spawn [Cyan] at [51] [-102] dir [-90]\n    end\n    if <(SCENE #) = [-102]> then\n        Spawn [Pink] at [-29] [-106] dir [-90]\n    end\n    if <(SCENE #) = [213]> then\n        Spawn [Cyan] at [-75] [-55] dir [-90]\n    end\n    if <(SCENE #) = [-201]> then\n        Spawn [Orange] at [40] [-111] dir [90]\n        Spawn [Orange] at [-52] [-111] dir [90]\n    end\n    if <(SCENE #) = [151]> then\n        Spawn [Purple] at [-111] [0] dir [90]\n    end\n    if <(SCENE #) = [305]> then\n        Spawn [Grey] at [112] [68] dir [-90]\n    end\n    if <(SCENE #) = [198]> then\n        Spawn [Purple] at [-174] [-108] dir [90]\n    end\n    if <(SCENE #) = [302]> then\n        Spawn [Yellow] at [25] [-24] dir [-90]\n    end\n    if <(SCENE #) = [2415]> then\n        Spawn [Yellow] at [-85] [-133] dir [-90]\n        Spawn [Yellow] at [85] [-133] dir [-90]\n    end\n    if <(SCENE #) = [15]> then\n        Spawn [Cyan] at [4] [39] dir [-90]\n    end\n    if <(SCENE #) = [19]> then\n        Spawn [Green] at [192] [-151] dir [-90]\n    end\n    if <(SCENE #) = [239]> then\n        Spawn [Green] at [-129] [-128] dir [-90]\n    end\n    if <(SCENE #) = [-199]> then\n        Spawn [Blue] at [80] [-59] dir [90]\n    end\n    if <(SCENE #) = [8]> then\n        Spawn [Blue] at [11] [-57] dir [90]\n    end\n    if <(SCENE #) = [-299]> then\n        Spawn [Blue] at [60] [-12] dir [-90]\n    end\n    if <(SCENE #) = [6]> then\n        Spawn [Blue] at [-114] [61] dir [90]\n    end\n    if <(SCENE #) = [70]> then\n        Spawn [Blue] at [159] [32] dir [-90]\n    end\n    if <(SCENE #) = [101]> then\n        Spawn [Blue] at [73] [-24] dir [-90]\n    end\n    if <(SCENE #) = [-599]> then\n        Spawn [Red] at [-85] [-59] dir [-90]\n    end\n    if <(SCENE #) = [2612]> then\n        Spawn [Cyan] at [-69] [-71] dir [90]\n    end\n    if <(SCENE #) = [8]> then\n        Spawn [Red] at [204] [-58] dir [-90]\n    end\n    if <(SCENE #) = [-398]> then\n        Spawn [Red] at [-100] [-49] dir [-90]\n        Spawn [Red] at [68] [-49] dir [-90]\n    end\n    if <(SCENE #) = [-99]> then\n        Spawn [Red] at [-46] [-28] dir [-90]\n        Spawn [Red] at [-163] [-98] dir [-90]\n        Spawn [Red] at [-76] [-100] dir [-90]\n    end\n    if <(SCENE #) = [0]> then\n        Spawn [Red] at [29] [-53] dir [-90]\n    end\n    if <(SCENE #) = [4]> then\n        Spawn [Red] at [37] [-93] dir [-90]\n    end\n    if <(SCENE #) = [157]> then\n        Spawn [Red] at [-58] [50] dir [-90]\n        Spawn [Red] at [58] [50] dir [90]\n    end\n    if <(SCENE #) = [92]> then\n        Spawn [Red] at [143] [57] dir [-90]\n        Spawn [Red] at [-113] [43] dir [90]\n    end\n    if <(SCENE #) = [209]> then\n        Spawn [Red] at [63] [-23] dir [-90]\n        Spawn [Red] at [-67] [-27] dir [-90]\n    end\n    if <(SCENE #) = [211]> then\n        Spawn [Red] at [81] [-92] dir [-90]\n        Spawn [Red] at [-59] [-92] dir [90]\n    end\n    if <(SCENE #) = [1404]> then\n        Spawn [Red] at [-58] [-24] dir [-90]\n        Spawn [Red] at [-90] [-114] dir [90]\n        Spawn [Blue] at [-74] [-110] dir [-90]\n        Spawn [Blue] at [0] [-110] dir [-90]\n        Spawn [Cyan] at [152] [-110] dir [-90]\n        Spawn [Cyan] at [205] [-110] dir [-90]\n    end\nend\n\nwhen I start as a clone\nshow\nset size to (140) %\nif <(enemy type) = [Red]> then\n    set [health v] to [1]\nelse\n    if <(enemy type) = [Blue]> then\n        set [health v] to [3]\n    else\n        if <(enemy type) = [Yellow]> then\n            set [health v] to [6]\n            set size to (160) %\n        else\n            if <(enemy type) = [Pink]> then\n                set [health v] to [4]\n            else\n                if <(enemy type) = [Purple]> then\n                    set [health v] to [18]\n                    set size to (250) %\n                else\n                    if <(enemy type) = [Orange]> then\n                        set [health v] to [12]\n                        set size to (180) %\n                    else\n                        if <(enemy type) = [Cyan]> then\n                            set [health v] to [2]\n                        else\n                            if <(enemy type) = [White]> then\n                                set [health v] to [8]\n                                set size to (170) %\n                            else\n                                set [health v] to [5]\n                                set size to (150) %\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [speed y v] to [0]\nset [frame v] to [0]\nforever\n    switch costume to (join (enemy type) [1])\n    set rotation style [don't rotate v]\n    Move - Left and Right\n    Move - Down\n    change [frame v] by (0.333)\n    switch costume to (join (enemy type) ((1) + (([floor v] of (frame) ) mod (4))))\n    if <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n        Touching Player \n    end\nend\n\nwhen I receive [exiting current scene v]\ndelete this clone\n\ndefine Move - Down\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat until <not <<<touching (level v)?> or <touching (jump through v)?>> or <touching (platform v)?>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine Move - Left and Right\nset rotation style [left-right v]\nmove (2) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <touching (safe zones v)?>> then\n            if <not <touching (jump through v)?>> then\n                if <not <touching (platform v)?>> then\n                    stop [this script v]\n                end\n            end\n        end\n    end\n    change y by (1)\nend\nchange y by (-4)\nset rotation style [left-right v]\nmove (-2) steps\nturn right (180) degrees\n\ndefine Touching Player \nif <(INVINCIBILITY) = [1]> then\n    stop [other scripts in sprite v]\n    switch costume to (join (enemy type) [1])\n    set rotation style [all around v]\n    point in direction (-90)\n    change y by (30)\n    set [speed y v] to [0]\n    set [speed x v] to [0]\n    repeat (30)\n        change [speed x v] by (0.1)\n        change x by (speed x)\n        change [speed y v] by (-1.5)\n        change y by (speed y)\n    end\n    delete this clone\nend\nif <(enemy type) = [Grey]> then\n    broadcast (Lose Life v)\n    stop [this script v]\nend\nif <(enemy type) = [Green]> then\n    if <([speed y v] of [player v]) < [-3]> then\n        broadcast (Player Bounce Higher v)\n        start sound [boing v]\n        switch costume to (green squish v)\n        wait (0.3) seconds\n        stop [this script v]\n    end\nelse\n    if <([speed y v] of [player v]) < [-3]> then\n        if <(mode) = [TM]> then\n            change [timer v] by (3)\n        end\n        change [health v] by (-1)\n        broadcast (Player - Bounce v)\n        if <(Health) = [0]> then\n            start sound [Squish Pop v]\n            switch costume to (join (enemy type) (join [ ] [Squish]))\n            wait (0.3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        else\n            start sound [Pop v]\n            if <(mode) = [TM]> then\n                change [timer v] by (1)\n            end\n            switch costume to (join (enemy type) (join [ ] [hit]))\n            wait (0.3) seconds\n            stop [this script v]\n        end\n    end\nend\nbroadcast (Lose Life v)\n\ndefine Spawn (type) at (x) (y) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\nset [enemy type v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = (join (enemy type) [1])> then\n        play sound [blipp v] until done\n    end\nend\n\n@Platform3\n\ndefine Door at (x) (y) key (key name)\npoint in direction (90)\nshow\nswitch costume to (lock v)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [platform: last x v] to (x position)\nset [platform: last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(Turn) > []> then\n    change y by (4)\n    if <touching (player v)?> then\n        Rotation Maths CCW ((0) - (Turn))\n    end\nelse\n    if <(new y) > (Platform: last y)> then\n        change y by (1)\n    else\n        set y to ((Platform: last y) + (1))\n    end\n    if <touching (player v)?> then\n        set [platform dx v] to ((new x) - (Platform: last x))\n        set [platform dy v] to ((new y) - (Platform: last y))\n    end\nend\ngo to x: (new x) y: (new y)\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nset [turn v] to [0]\nset [id v] to [0]\nif <(SCENE #) = [508]> then\n    Spawn [Cross] at [0] [54] dir [90] Turn [1.5]\nend\nif <(SCENE #) = [-260]> then\n    Spawn [X] at [-140] [-21] dir [90] Turn [1]\n    Spawn [X] at [32] [-21] dir [90] Turn [-1]\nend\nif <(SCENE #) = [1704]> then\n    Spawn [X] at [85] [0] dir [90] Turn [1.5]\nend\nif <(SCENE #) = [320]> then\n    Spawn [Square] at [102] [-32] dir [90] Turn [1]\nend\nif <(SCENE #) = [-358]> then\n    Spawn [Triple Square] at [0] [5] dir [90] Turn [1.5]\nend\nif <(SCENE #) = [183]> then\n    Spawn [Plank] at [0] [0] dir [90] Turn [1.5]\nend\nif <(SCENE #) = [327]> then\n    Spawn [Square] at [0] [0] dir [90] Turn [1]\nend\nif <(SCENE #) = [219]> then\n    switch costume to (dark blue platform v)\n    show\n    Animate 219-3\nend\nif <(SCENE #) = [85]> then\n    Spawn [Rotating Circle2] at [7] [1] dir [27] Turn [1]\nend\nif <(SCENE #) = [331]> then\n    Spawn [X] at [-158] [0] dir [-45] Turn [-1]\nend\nif <(SCENE #) = [52]> then\n    Spawn [Square] at [-8] [-23] dir [90] Turn (pick random (-1) to (1))\nend\nif <(SCENE #) = [1301]> then\n    Spawn [Double Cup] at [0] [0] dir [90] Turn [-0.5]\nend\nif <(SCENE #) = [-6]> then\n    Spawn [Square] at [-49] [-10] dir [90] Turn [5]\nend\nif <(SCENE #) = [324]> then\n    Spawn [X] at [0] [0] dir [90] Turn [1]\nend\nif <(SCENE #) = [-4]> then\n    Spawn [Plank4] at [-151] [44] dir [90] Turn [1]\n    Spawn [Plank4] at [-151] [-20] dir [90] Turn [-1]\n    Spawn [Plank4] at [-151] [-84] dir [90] Turn [1]\nend\nif <(SCENE #) = [-495]> then\n    Spawn [Square] at [-73] [-12] dir [90] Turn [-1]\n    Spawn [Square] at [-73] [-12] dir [90] Turn [1]\n    Spawn [Square] at [106] [-43] dir [90] Turn [1]\n    Spawn [Square] at [106] [-43] dir [90] Turn [-1]\nend\nif <(SCENE #) = [-399]> then\n    Spawn [Cup] at [3] [-2] dir [90] Turn [1]\nend\nif <(SCENE #) = [-303]> then\n    Spawn [Square] at [-106] [38] dir [90] Turn [Wobble]\n    Spawn [Rectangle] at [60] [-15] dir [90] Turn [Wobble]\nend\nif <(SCENE #) = [-302]> then\n    Spawn [Square] at [96] [-48] dir [90] Turn [Wobble]\nend\nif <(SCENE #) = [-301]> then\n    Spawn [????] at [-119] [28] dir [90] Turn [1]\nend\nif <(SCENE #) = [-92]> then\n    Spawn [Square] at [7] [-10] dir [90] Turn [-0.5]\nend\nif <(SCENE #) = [-90]> then\n    Spawn [Cross] at [4] [61] dir [90] Turn [0.9]\nend\nif <(SCENE #) = [-101]> then\n    Spawn [Rectangle] at [-46] [-5] dir [90] Turn [1]\nend\nif <(SCENE #) = [40]> then\n    Spawn [X] at [0] [-39] dir [90] Turn [1.5]\nend\nif <(SCENE #) = [-1]> then\n    Spawn [Square] at [86] [28] dir [90] Turn [1]\n    Spawn [Plank] at [-79] [-20] dir [90] Turn [-0.5]\nend\nif <(SCENE #) = [802]> then\n    Spawn [Square] at [-41] [-38] dir [0] Turn [1]\n    Spawn [Square] at [-41] [-38] dir [0] Turn [-1]\nend\nif <(SCENE #) = [-2]> then\n    Spawn [Rotating Circle] at [13] [-137] dir [0] Turn [1]\nend\nif <(SCENE #) = [-3]> then\n    Spawn [Plank2] at [17] [0] dir [0] Turn [-1]\nend\nif <(SCENE #) = [57]> then\n    Spawn [Square] at [45] [-11] dir [0] Turn [1]\nend\nif <(SCENE #) = [75]> then\n    Spawn [Rotating Circle] at [3] [-127] dir [0] Turn [1]\nend\nif <(SCENE #) = [83]> then\n    Spawn [Rectangle] at [-84] [-10] dir [27] Turn [1]\n    Spawn [Square] at [112] [-51] dir [90] Turn [1]\nend\nif <(SCENE #) = [86]> then\n    Spawn [Plank4] at [-172] [0] dir [90] Turn [1]\n    Spawn [Plank4] at [172] [0] dir [90] Turn [1]\nend\nif <(SCENE #) = [131]> then\n    Spawn [Square] at [-120] [-22] dir [0] Turn [1]\n    Spawn [Square] at [76] [-22] dir [0] Turn [1]\n    Spawn [Platform \(Horizontal\)] at [-144] [-110] dir [0] Turn []\n    Spawn [Platform \(Vertical\)] at [-24] [0] dir [0] Turn []\nend\nif <(SCENE #) = [134]> then\n    Spawn [Cross] at [5] [-13] dir [0] Turn [1]\nend\nif <(SCENE #) = [149]> then\n    Spawn [Plank] at [6] [119] dir [0] Turn [1]\nend\nif <(SCENE #) = [158]> then\n    Spawn [Triple Square] at [-10] [32] dir [0] Turn [1]\nend\nif <(SCENE #) = [206]> then\n    Spawn [Plank4] at [5] [-105] dir [0] Turn [1]\n    Spawn [Plank4] at [5] [-40] dir [90] Turn [1]\n    Spawn [Plank4] at [5] [15] dir [0] Turn [1]\n    Spawn [Plank4] at [5] [75] dir [90] Turn [1]\nend\nif <(SCENE #) = [210]> then\n    if <([x position v] of [player v]) > [0]> then\n        Spawn [Plank4] at [-126] [-47] dir [150] Turn [-0.9]\n        Spawn [Plank4] at [-34] [-47] dir [125] Turn [-0.9]\n        Spawn [Plank4] at [58] [-47] dir [100] Turn [-0.9]\n        Spawn [Plank4] at [150] [-47] dir [75] Turn [-0.9]\n    else\n        Spawn [Plank4] at [-126] [-47] dir [150] Turn [0.9]\n        Spawn [Plank4] at [-34] [-47] dir [125] Turn [0.9]\n        Spawn [Plank4] at [58] [-47] dir [100] Turn [0.9]\n        Spawn [Plank4] at [150] [-47] dir [75] Turn [0.9]\n    end\nend\nif <(SCENE #) = [229]> then\n    Spawn [Square] at [-3] [18] dir [0] Turn [1]\nend\nif <(SCENE #) = [231]> then\n    Spawn [Rotating Circle] at [-2] [-120] dir [0] Turn [1]\nend\nif <(SCENE #) = [230]> then\n    Spawn [Double Cup] at [3] [8] dir [0] Turn [1]\nend\nif <(SCENE #) = [232]> then\n    Spawn [Plank2] at [48] [12] dir [0] Turn [1]\nend\nif <(SCENE #) = [234]> then\n    Spawn [Triple Square] at [5] [51] dir [0] Turn [1]\nend\nif <(SCENE #) = [240]> then\n    Spawn [Triple Square] at [5] [-7] dir [0] Turn [1]\nend\nif <(SCENE #) = [319]> then\n    Spawn [Double Cup2] at [-8] [73] dir [0] Turn [1]\nend\nif <(SCENE #) = [321]> then\n    Spawn [Triple Square] at [-8] [73] dir [0] Turn [0.5]\nend\nif <(SCENE #) = [407]> then\n    Spawn [Cup] at [0] [0] dir [0] Turn [1]\nend\nif <(SCENE #) = [903]> then\n    Spawn [Plank] at [0] [0] dir [0] Turn [4]\nend\nif <(SCENE #) = [1303]> then\n    Spawn [Square] at [24] [9] dir [0] Turn [1]\nend\nif <(SCENE #) = [-5]> then\n    Spawn [Plank5] at [0] [0] dir [0] Turn [1]\n    Spawn [Plank4] at [123] [10] dir [0] Turn [1]\nend\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\n\nwhen I receive [exiting current scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) dir (dir) Turn (degrees)\nset [turn v] to (degrees)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif < (costume [name v]) contains [Lock]?> then\n    Door at (x position) (y position) key [Key 1]\nend\nif <(costume [name v]) = [Platform \(Vertical\)]> then\n    Animate 9\nend\nif <(costume [name v]) = [Plank3]> then\n    thing\nend\nif <(Turn) > []> then\n    show\n    set rotation style [all around v]\n    forever\n        if <(Turn) = [Wobble]> then\n            point in direction ((90) + (([sin v] of (((timer) - (1)) * (100)) ) * (10)))\n        else\n            turn right (Turn) degrees\n        end\n    end\nend\nAnimate Horizontal\n\nAnimate 9\n\ndefine Rotation Maths CCW (ccw)\nset [dx v] to (([x position v] of [player v]) - (x position))\nset [dy v] to (([y position v] of [player v]) - (y position))\nset [sin v] to ([sin v] of (ccw) )\nset [cos v] to ([cos v] of (ccw) )\nset [platform dx v] to ((((dx) * (cos)) - ((dy) * (sin))) - (dx))\nset [platform dy v] to ((((dx) * (sin)) + ((dy) * (cos))) - (dy))\n\ndefine Animate Horizontal\nshow\nforever\n    glide (3) secs to x: ((x position) + (180)) y: (y position)\n    wait (1) seconds\n    glide (3) secs to x: ((x position) - (180)) y: (y position)\n    wait (1) seconds\nend\n\ndefine Animate 219-3\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    glide (0.9) secs to x: (0) y: (-55)\n    glide (0.9) secs to x: (0) y: (0)\nend\n\ndefine Animate 1\ngo to x: (87) y: (-134)\nforever\n    glide (5) secs to x: (87) y: (134)\n    wait (1) seconds\n    glide (5) secs to x: (87) y: (-134)\n    wait (1) seconds\nend\n\ndefine thing\nshow\ngo to x: (-116) y: (-59)\nforever\n    glide (3) secs to x: (104) y: (-59)\n    wait (1) seconds\n    glide (3) secs to x: (-117) y: (-59)\n    wait (1) seconds\nend\n\ndefine Animate 9\nswitch costume to (platform \(vertical\) v)\nshow\nforever\n    glide (1) secs to x: (x position) y: ((y position) + (60))\n    wait (1) seconds\n    glide (1) secs to x: (x position) y: ((y position) - (60))\n    wait (1) seconds\nend\n\ngo to x: (26) y: (-201)\nforever\n    repeat (101)\n        change y by (4)\n        turn right (3) degrees\n    end\n    set y to (-201)\nend\n\n@Safe Zones\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\n@Jump Through\n\ndefine Stamp shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-10)\nstamp\nchange y by (10)\nclear graphic effects\n\ndefine Stamp outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (1) seconds\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nStamp shadow\nStamp outline\n\nwhen flag clicked\nclear graphic effects\nwait (0.5) seconds\ngo to x: (0) y: (0)\n\nset [scene # v] to [60]\n\n@Sawblades\n\nwhen I receive [change scene v]\nset [turn v] to [0]\ngo to [back v] layer\nhide\nif <(SCENE #) = [208]> then\n    show\n    Animate 12\nend\nif <(SCENE #) = [1404]> then\n    show\n    Animate 14\nend\nif <(SCENE #) = [-202]> then\n    show\n    Animate 15\nend\nif <(SCENE #) = [37]> then\n    show\n    Animate 16\nend\n\ndefine Animate 12\nset [turn v] to [-15]\ngo to x: (-100) y: (-38)\nforever\n    glide (5) secs to x: (100) y: (-38)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (-1)\n    end\n    set [turn v] to [15]\n    glide (5) secs to x: (-100) y: (-38)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (1)\n    end\n    set [turn v] to [-15]\nend\n\ndefine Animate 13\nset [turn v] to [-15]\ngo to x: (100) y: (-111)\nforever\n    glide (5) secs to x: (-100) y: (-111)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (-1)\n    end\n    set [turn v] to [-15]\n    glide (5) secs to x: (100) y: (-111)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (1)\n    end\n    set [turn v] to [15]\nend\n\ndefine Animate 14\nset [turn v] to [-15]\ngo to x: (146) y: (-126)\nforever\n    glide (4) secs to x: (-119) y: (-126)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (-1)\n    end\n    set [turn v] to [-15]\n    glide (4) secs to x: (146) y: (-126)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (1)\n    end\n    set [turn v] to [15]\nend\n\ndefine Animate 15\ngo to x: (179) y: (-114)\nset [turn v] to [-15]\nforever\n    glide (3) secs to x: (10) y: (-114)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (1)\n    end\n    set [turn v] to [-15]\n    glide (3) secs to x: (179) y: (-114)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (-1)\n    end\n    set [turn v] to [15]\nend\n\nwhen I receive [change scene v]\nforever\n    if <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n        broadcast (Lose Life v)\n        if <(turn) > [0]> then\n            repeat until <(turn) = [0]>\n                change [turn v] by (-1)\n            end\n        else\n            repeat until <(turn) = [0]>\n                change [turn v] by (1)\n            end\n        end\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen I receive [change scene v]\nforever\n    turn right (turn) degrees\nend\n\ndefine Animate 16\ngo to x: (17) y: (-150)\nset [turn v] to [15]\nforever\n    glide (3) secs to x: (-129) y: (-150)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (1)\n    end\n    set [turn v] to [-15]\n    glide (3) secs to x: (17) y: (-150)\n    wait (1) seconds\n    repeat (30)\n        change [turn v] by (-1)\n    end\n    set [turn v] to [15]\nend\n\n@Trampoline\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset size to (75) %\nhide\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [-259]> then\n    Spawn [Trampoline2] at [-158] [18] dir [180]\n    Spawn [Trampoline2] at [-158] [-76] dir [180]\nend\nif <(SCENE #) = [331]> then\n    Spawn [Trampoline] at [-3] [-140] dir [90]\nend\nif <(SCENE #) = [40]> then\n    Spawn [Trampoline2] at [-151] [-9] dir [181]\nend\nif <(SCENE #) = [310]> then\n    Spawn [Trampoline2] at [-48] [89] dir [180]\nend\nif <(SCENE #) = [322]> then\n    Spawn [Trampoline2] at [-161] [-19] dir [180]\nend\nif <(SCENE #) = [23]> then\n    Spawn [Trampoline2] at [-192] [85] dir [179]\nend\nif <(SCENE #) = [-103]> then\n    Spawn [Trampoline] at [-103] [-111] dir [90]\n    Spawn [Trampoline] at [-27] [-111] dir [90]\nend\nif <(SCENE #) = [-95]> then\n    Spawn [Trampoline] at [68] [-96] dir [90]\nend\nif <(SCENE #) = [33]> then\n    Spawn [Trampoline] at [172] [-154] dir [90]\nend\nif <(SCENE #) = [93]> then\n    Spawn [Trampoline] at [33] [-86] dir [90]\nend\nif <(SCENE #) = [102]> then\n    Spawn [Trampoline] at [177] [-23] dir [90]\nend\nif <(SCENE #) = [2412]> then\n    Spawn [Trampoline] at [207] [-135] dir [90]\n    Spawn [Trampoline] at [-168] [-135] dir [90]\nend\n\ndefine Trampoline Animation\nif <(type) = [Trampoline]> then\n    switch costume to (1 v)\n    repeat (8)\n        next costume\n    end\nelse\n    switch costume to (1a v)\n    repeat (8)\n        next costume\n    end\nend\n\nwhen I receive [exiting current scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) dir (dir)\nset [type v] to (type)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif <(type) = [Trampoline]> then\n    switch costume to (1 v)\nelse\n    switch costume to (1a v)\nend\nforever\n    if <touching (player v)?> then\n        if <([speed y v] of [player v]) < [-3]> then\n            if <(type) = [Trampoline]> then\n                start sound [boing v]\n                broadcast (trampoline v)\n                Trampoline Animation\n                switch costume to (1 v)\n            end\n        end\n        if <(type) = [Trampoline2]> then\n            start sound [boing v]\n            broadcast (trampoline2 v)\n            Trampoline Animation\n            switch costume to (1a v)\n        end\n    end\nend\n\n@Decoration\n\ndefine Stamp shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-10)\nstamp\nchange y by (10)\nclear graphic effects\n\ndefine Stamp outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (0.001) seconds\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <not <(SCENE #) = [100]>> then\n    Stamp shadow\n    Stamp outline\nend\n\nwhen flag clicked\nclear graphic effects\nwait (0.5) seconds\ngo to x: (0) y: (0)\n\nset [scene # v] to [60]\n\n@Water\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (30)\nshow\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\n@Npc\n\ndefine speak (string)\nset [speech v] to []\nset [index v] to [1]\nrepeat (length of (string))\n    switch costume to (join (npctype) [talk])\n    set [speech v] to (join (Speech) (letter (Index) of (string)))\n    say (Speech)\n    start sound [recording1 v]\n    if <(letter (Index) of (string)) = [,]> then\n        wait (0.5) seconds\n    end\n    if < [.!?] contains (letter (Index) of (string))?> then\n        wait (1) seconds\n    end\n    wait (0) seconds\n    change [index v] by (1)\nend\nif <(letter (Index) of (string)) = [-]> then\nswitch costume to (npctype)\n\ndefine spawn (type) scene (scene#) X (x) Y (y) dir (direction)\nif <(SCENE #) = (scene#)> then\n    switch costume to (type)\n    set [npctype v] to (type)\n    go to x: (x) y: (y)\n    go to [back v] layer\n    go [backward v] (1) layers\n    point in direction (direction)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [change scene v]\nhide\nspawn [npc2] scene [-359] X [-160] Y [-22] dir [-90]\nspawn [npc2] scene [-362] X [-133] Y [-85] dir [-90]\nspawn [npc] scene [305] X [-113] Y [84] dir [-90]\nspawn [npc] scene [-365] X [99] Y [-81] dir [-90]\nspawn [npc] scene [326] X [-27] Y [-90] dir [-90]\nspawn [npc] scene [13] X [-184] Y [33] dir [-90]\nspawn [npc] scene [-94] X [-71] Y [97] dir [-90]\nspawn [npc] scene [-301] X [54] Y [-112] dir [-90]\nspawn [npc] scene [-95] X [17] Y [-97] dir [-90]\nspawn [npc] scene [1] X [-69] Y [-52] dir [-90]\nspawn [npc] scene [-99] X [-157] Y [12] dir [-90]\nspawn [npc] scene [0] X [-57] Y [27] dir [-90]\nspawn [npc] scene [3] X [-89] Y [-5] dir [-90]\nspawn [npc] scene [208] X [-169] Y [-26] dir [-90]\nspawn [npc] scene [-199] X [127] Y [-7] dir [-90]\nspawn [npc] scene [102] X [128] Y [-24] dir [90]\nspawn [npc] scene [-101] X [90] Y [-51] dir [90]\nspawn [npc] scene [302] X [162] Y [58] dir [-90]\nspawn [npc] scene [103] X [151] Y [-59] dir [-90]\nspawn [npc] scene [2415] X [23] Y [21] dir [-90]\nspawn [npc] scene [2] X [-172] Y [31] dir [-90]\nspawn [npc] scene [333] X [-184] Y [-75] dir [-90]\n\nwhen I start as a clone\nforever\n    if <not <(mode) = [CTM]>> then\n        show\n        if <touching (player v)?> then\n            say [press e to interact]\n            if <key (e v) pressed?> then\n                if <(SCENE #) = [-359]> then\n                    speak [This dimension is slightly harder]\n                    speak [So be careful]\n                end\n                if <(SCENE #) = [-362]> then\n                    speak [Yo what's up, I'm npc's step cousin]\n                    speak [npc2]\n                    speak [Our developer named us like this, don't ask why]\n                    speak [I'll be your guide for the snow dimension]\n                    speak [it's quite cold here, bring a jacket]\n                end\n                if <(SCENE #) = [305]> then\n                    speak [That grey enemy has a spike on it's head]\n                    speak [So you can't squish it]\n                    speak [This also means it's immortal]\n                end\n                if <(SCENE #) = [-365]> then\n                    speak [Welcome to the snow dimension!]\n                end\n                if <(SCENE #) = [206]> then\n                    speak [These are drop through platforms]\n                    speak [press the down key or S to drop through]\n                end\n                if <<<(SCENE #) = [-94]> or <(SCENE #) = [13]>> or <(SCENE #) = [333]>> then\n                    speak [These are shift-boxing platforms]\n                    speak [It is inspired by theapplesguy2]\n                    speak [press space to change it's state]\n                    speak [light blue is non-solid, dark blue is solid]\n                end\n                if <(SCENE #) = [2]> then\n                    speak [Just want to say, cyan enemies have 2 health]\n                    speak [They can be found in scene 213]\n                end\n                if <(SCENE #) = [326]> then\n                    speak [We are building 25 more scenes on the 3rd floor]\n                end\n                if <(SCENE #) = [-301]> then\n                    speak [I am the first one made in the game]\n                end\n                if <(SCENE #) = [1]> then\n                    speak [These are moving platforms]\n                    speak [and also be careful of the spikes]\n                end\n                if <(SCENE #) = [-99]> then\n                    speak [Hi friend]\n                    speak [there are lots of enemies here]\n                end\n                if <<(SCENE #) = [102]> or <(SCENE #) = [-95]>> then\n                    speak [These are trampolines]\n                    speak [Makes you jump higher]\n                end\n                if <(SCENE #) = [2415]> then\n                    speak [Yellow enemies belong here]\n                end\n                if <(SCENE #) = [0]> then\n                    speak [Welcome to platformer world]\n                    speak [There are lots of elements]\n                    speak [Jump on an enemy's head to kill it]\n                    speak [Avoid spikes and lava]\n                    speak [and also thanks for more than 1400 views!]\n                end\n                if <(SCENE #) = [3]> then\n                    speak [be careful of the lava!]\n                end\n                if <(SCENE #) = [103]> then\n                    speak [Hi, nothing much to say, but there are bananas]\n                end\n                if <(SCENE #) = [-199]> then\n                    speak [Ooh golden apples]\n                    speak [1 golden apple equals to 5 apples]\n                    speak [careful of the enemy tho]\n                end\n                if <(SCENE #) = [208]> then\n                    speak [Watch out for that sawblade!]\n                end\n                if <(SCENE #) = [-101]> then\n                    speak [This place is made for fun]\n                    speak [The developer just wanted to add more scenes]\n                    speak [They are scenes -101 -102 -103 -201 -202 -203 -301 -302 -303 -401 -402 -403]\n                end\n                if <(SCENE #) = [302]> then\n                    speak [That enemy has 6 health, while the blue one has 3]\n                end\n            end\n        else\n            say []\n        end\n    end\nend\n\nwhen I receive [exiting current scene v]\ndelete this clone\n\n@Portal\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [-366]> then\n    switch costume to (portal2 v)\n    show\n    go to x: (-144) y: (23)\nend\nif <(SCENE #) = [100]> then\n    switch costume to (portal v)\n    show\n    go to x: (129) y: (0)\nend\nif <(SCENE #) = [2612]> then\n    switch costume to (portal v)\n    show\n    go to x: (-140) y: (7)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nforever\n    if <touching (player v)?> then\n        if <(SCENE #) = [-366]> then\n            broadcast (Exit v)\n            stop [this script v]\n        else\n            broadcast (You Win! v)\n            stop [this script v]\n        end\n    end\nend\n\n@Fun settings\n\nwhen this sprite clicked\nstart sound [coin 2 v]\nif <(costume [name v]) = [RM]> then\n    broadcast (RM v)\nelse\n    if <(costume [name v]) = [WM]> then\n        broadcast (WM v)\n    else\n        if <(costume [name v]) = [DM]> then\n            broadcast (DM v)\n        else\n            if <(costume [name v]) = [CTM]> then\n                broadcast (CTM v)\n            else\n                broadcast (NM v)\n            end\n        end\n    end\nend\nhide\nset [mode v] to (costume [name v])\nset [hide? v] to [true]\nbroadcast (Start game v)\n\nwhen I receive [settings v]\nforever\n    if <(hide?) = [true]> then\n        stop [this script v]\n    end\n    if <touching (mouse-pointer v)?> then\n        start sound [click v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [settings v]\nSpawn [LM] [155] [-90]\nSpawn [HM] [155] [30]\nSpawn [NM] [-164] [30]\nSpawn [DM] [0] [-90]\nSpawn [RM] [0] [25]\nSpawn [TM] [-150] [-90]\n\nwhen I start as a clone\nswitch costume to (thing)\nset [hide? v] to [false]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\nforever\n    if <(thing) = [RM]> then\n        change [color v] effect by (5)\n    end\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((115) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine Spawn (thing) (x) (y)\nset [thing v] to (thing)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [start game v]\nhide\ndelete this clone\n\nwhen I receive [settings v]\nswitch costume to (rm v)\n\nwhen I receive [settings2 v]\nSpawn [CTM] [0] [0]\n\n@Music\n\nwhen this sprite clicked\nif <(costume [name v]) = [Yes]> then\n    switch costume to (no v)\n    set [music? v] to [0]\nelse\n    switch costume to (yes v)\n    set [music? v] to [1]\nend\n\nwhen flag clicked\nwait (0.0001) seconds\ngo to [front v] layer\nset [music? v] to [1]\nshow\n\nwhen I receive [open v]\nset [can click? v] to [0]\ngo to x: (0) y: (63)\nwait (0.58) seconds\nshow\nswitch costume to (yes v)\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((230) - (size)))\n    else\n        change size by ((0.2) * ((200) - (size)))\n    end\nend\n\nwhen I receive [go v]\nset [can click? v] to [1]\nhide\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [more settings v]\nhide\n\nwhen I receive [settings2 v]\nhide\n\nwhen I receive [announcements v]\nhide\n\n@Light\n\nwhen I receive [dm v]\nshow\nswitch costume to (dot v)\nset size to (400) %\nswitch costume to (flashlight v)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [game over v]\nhide\n\nwhen I receive [win screen v]\nhide\n\nwhen I receive [ctm v]\nshow\nswitch costume to (dot v)\nset size to (400) %\nswitch costume to (flashlight v)\nforever\n    go to (player v)\nend\n\nwhen I receive [ctm v]\nforever\n    go to [front v] layer\n    wait (0.5) seconds\nend\n\nwhen I receive [dm v]\nforever\n    go to [front v] layer\nend\n\n@Falling Platforms\n\ndefine Animate - Platform\nshow\ngo to [back v] layer\npoint in direction (90)\ngo to x: (my x) y: (my y)\nset [ghost v] effect to (0)\nset size to (100) %\nforever\n    if <<touching (player v)?> and <([y position v] of [player v]) > (y position)>> then\n        repeat (15)\n            go to x: (my x) y: (my y)\n            change y by (pick random (-5) to (5))\n            change x by (pick random (-5) to (5))\n            wait (0) seconds\n        end\n        set [speed y v] to [0]\n        go to x: (my x) y: (my y)\n        repeat until <touching (_edge_ v)?>\n            change y by (Speed Y)\n            change [speed y v] by (-2)\n        end\n        hide\n        wait (2) seconds\n        go to x: (my x) y: (my y)\n        if <(SCENE #) = (Dynamic Objects//Falling Platforms: my scene)> then\n            set size to (0) %\n            show\n            repeat until <(size) = [100]>\n                change size by (((100) - (size)) * (0.3))\n            end\n        end\n    end\nend\n\ndefine Rotation math CCW (ccw)\nset [dx v] to (([x position v] of [player v]) - (x position))\nset [dy v] to (([y position v] of [player v]) - (y position))\nset [sin v] to ([sin v] of (ccw) )\nset [cos v] to ([cos v] of (ccw) )\nset [platform dx v] to ((((dx) * (cos)) - ((dy) * (sin))) - (dx))\nset [platform dy v] to ((((dx) * (sin)) + ((dy) * (cos))) - (dy))\n\ndefine Tick (new x) (new y)\nif <(Health) > []> then\n    change y by (4)\n    if <touching (player v)?> then\n        Rotation math CCW ((0) - (Health))\n    end\nelse\n    if <(new y) > (Dynamic Objects//Falling Platforms: last y)> then\n        change y by (1)\n    else\n        set y to ((Dynamic Objects//Falling Platforms: last y) + (1))\n    end\n    if <touching (player v)?> then\n        set [platform dx v] to (((new x) - (Dynamic Objects//Falling Platforms: last x)) * (DX cancel))\n        set [platform dy v] to (((new y) - (Dynamic Objects//Falling Platforms: last y)) * (Dynamic Objects//Falling Platforms: DY cancel))\n        set [dynamic objects//falling platforms: dy cancel v] to [1]\n        set [dx cancel v] to [1]\n    end\nend\ngo to x: (new x) y: (new y)\n\nTick (x position) (y position)\nset [dynamic objects//falling platforms: last x v] to (x position)\nset [dynamic objects//falling platforms: last y v] to (y position)\n\nwhen I receive [change scene v]\nif <(SCENE #) = [315]> then\n    Spawn [Platform2] [0] [-16] spawn scene [315]\nend\nif <(SCENE #) = [304]> then\n    Spawn [Platform] [-85] [51] spawn scene [304]\n    Spawn [Platform] [95] [51] spawn scene [304]\nend\nif <(SCENE #) = [216]> then\n    Spawn [Platform] [17] [32] spawn scene [216]\n    Spawn [Platform] [-99] [64] spawn scene [216]\n    Spawn [Platform] [142] [14] spawn scene [216]\nend\nif <(SCENE #) = [-362]> then\n    Spawn [Platform] [27] [-53] spawn scene [-362]\nend\n\nwhen I receive [change scene v]\ndelete this clone\n\ndefine Spawn (item) (x) (y) spawn scene (scene)\nset [dynamic objects//falling platforms: my scene v] to (scene)\ngo to x: (x) y: (y)\nset [my x v] to (x)\nset [my y v] to (y)\nswitch costume to (item)\ncreate clone of (_myself_ v)\nset [dynamic objects//falling platforms: my scene v] to []\n\nwhen I start as a clone\nAnimate - Platform\n\nwhen I receive [lose life v]\nwait (0.5) seconds\ndelete this clone\n\nwhen I receive [game over v]\ndelete this clone\n\n@Shift-Boxing Platforms\n\ndefine Stamp outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join (join [Scene] (SCENE #)) (join [ ] (id)))\nStamp shadow\nStamp outline\n\ndefine Stamp shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen flag clicked\ngo to [back v] layer\nwait (1) seconds\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    wait until <key (space v) pressed?>\n    set [id v] to [1]\n    broadcast (change v)\n    wait until <not <key (space v) pressed?>>\n    wait until <key (space v) pressed?>\n    set [id v] to [0]\n    broadcast (change v)\n    wait until <not <key (space v) pressed?>>\nend\n\nwhen I receive [change v]\ngo to [back v] layer\nswitch costume to (join (join [Scene] (SCENE #)) (join [ ] (id)))\n\n@Moving Spikes\n\nwhen I receive [change scene v]\nhide\ngo to [back v] layer\nif <(SCENE #) = [112]> then\n    show\n    switch costume to (moving spike 7 v)\n    Animate Spike Loop\nend\nif <(SCENE #) = [42]> then\n    show\n    switch costume to (moving spike 7 v)\n    Animate Spike Loop\nend\nif <(SCENE #) = [-359]> then\n    show\n    switch costume to (moving spike v)\n    Animate Spike Loop 2\nend\nif <(SCENE #) = [310]> then\n    show\n    switch costume to (moving spike 7 v)\n    Animate Spike Loop 3\nend\nif <(SCENE #) = [-70]> then\n    show\n    switch costume to (moving spike 7 v)\n    Animate Spike Loop\nend\nif <(SCENE #) = [84]> then\n    show\n    switch costume to (moving spike 7 v)\n    Animate Spike Loop\nend\nif <(SCENE #) = [309]> then\n    Animate Spike [120] [38] [-120] [38] [3] [3] Spike Type [Moving Spike]\n    Animate Spike [-120] [133] [120] [133] [3] [3] Spike Type [Moving Spike 4]\nend\nif <(SCENE #) = [-363]> then\n    Animate Spike [-38] [-13] [139] [-13] [3] [3] Spike Type [Moving Spike 5]\n    Animate Spike [139] [-13] [-38] [-13] [3] [3] Spike Type [Moving Spike 5]\nend\nif <(SCENE #) = [331]> then\n    Animate Spike [-6] [-53] [-6] [45] [2] [2] Spike Type [Moving Spike 6]\nend\n\ndefine Animate Spike (x) (y) (x2) (y2) (time) (time2) Spike Type (spike type)\ngo to x: (x2) y: (y2)\nset [x v] to (x)\nset [x2 v] to (x2)\nset [y v] to (y)\nset [y2 v] to (y2)\nset [time v] to (time)\nset [time2 v] to (time2)\nset [spike type v] to (spike type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nswitch costume to (spike type)\ngo to x: (x2) y: (y2)\nforever\n    glide (time) secs to x: (x) y: (y)\n    wait (1) seconds\n    glide (time2) secs to x: (x2) y: (y2)\n    wait (1) seconds\nend\n\nwhen I receive [exiting current scene v]\ndelete this clone\n\ndefine Animate Spike Loop\ngo to x: (0) y: (0)\nforever\n    repeat (89)\n        change y by (-2)\n        go to [back v] layer\n    end\n    set y to (0)\nend\n\ndefine Animate Spike Loop 2\ngo to x: (0) y: (-4)\nforever\n    repeat (72)\n        change y by (2)\n    end\n    set y to (-4)\nend\n\ndefine Animate Spike Loop 3\ngo to x: (45) y: (0)\nforever\n    repeat (89)\n        change y by (-2)\n        go to [back v] layer\n    end\n    set y to (0)\nend\n\n