Classic Platformer #trending #all #games #art #music #tutorials
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@Music\n\nwhen flag clicked\nforever\n    play sound [Vexento - Saga v] until done\nend\n\nwhen I receive [outro v]\nstop all sounds\n\n@Splash Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (title screen v)\ngo to [front v] layer\nset size to (100) %\nshow\n\nwhen I receive [game over! v]\ngo to x: (0) y: (0)\nswitch costume to (game over v)\ngo to [front v] layer\nset size to (100) %\nshow\nbroadcast (MAIN MENU v)\n\nwhen I receive [start game v]\nhide\n\n@Main Menu\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nset size to (10) %\ngo to [front v] layer\nshow\ngo to x: (0) y: (-85)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nhide\nbroadcast (Start Game v)\n\n@Player\n\nwhen flag clicked\nbroadcast (MAIN MENU v)\nhide variable [coins v]\nhide variable [lives v]\nhide variable [scene # v]\n\ndefine Move - In Steps (steps)\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\nchange [falling v] by (1)\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (platform 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 platform 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 platform 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\nswitch backdrop to <touching (level v)?>\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?> - <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    if <not <(direction) = ((KEY X) * (90))>> then\n        set [wall slide v] to [0]\n    end\n    point in direction ((KEY X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((Speed X) * (RESISTANCE))\n\ndefine Reset and Begin Level\nset [invulnerable v] to [0]\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]\npoint in direction (90)\nBegin Scene # (SPAWN SCENE) Go To x, y: (SPAWN X) (SPAWN Y)\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 - Player v)\n    broadcast (Tick Last v)\nend\n\nwhen I receive [tick last v]\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 \(spike\) v)?> or <touching (danger \(lava\) v)?>> then\n    broadcast (Lose Life v)\nend\n\ndefine Fix Collision In Direction (direction)\nset [temporary 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 (Temporary)\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 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 (About To Change 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 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 Controls - Up and Down\nif <key (up arrow v) pressed?> then\n    if <<(Wall Slide) > [0]> and <(Jumping) = [0]>> then\n        start sound [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 [12]\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\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\nwhen I receive [lose life v]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops 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)\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 [temporary 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 (Temporary)\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 (Temporary)\n\nwhen I receive [start game v]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\nbroadcast (Reset Game v) and wait\nbroadcast (Setup v) and wait\nset [lives v] to [9]\nset [spawn scene v] to [1]\nset [spawn x v] to [-169]\nset [spawn y v] to [60]\nshow variable [coins v]\nshow variable [lives v]\nshow variable [scene # v]\nReset and Begin Level\n\nwhen I receive [player bounce v]\nset [speed y v] to [10]\n\n@Level\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 Outline\nStamp Shadow\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\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 I receive [about to change scene v]\nerase all\n\nwhen flag clicked\nforever\n    if <(Scene #) = [203]> then\n        wait (5) seconds\n        hide variable [coins v]\n        hide variable [lives v]\n        hide variable [scene # v]\n        broadcast (OUTRO v)\n    end\n    stop [this script v]\nend\n\n@Jump Through Platform\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 (blank v)\nswitch costume to (join [Scene] (Scene #))\nStamp Outline\nStamp Shadow\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\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\n@Danger (Spike)\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 (blank v)\nswitch costume to (join [Scene] (Scene #))\n\n@Danger (Lava)\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\nif <(Scene #) = [4]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (180)) ))\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\n@Platform\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\nwhen I receive [change scene v]\nhide\ngo to [back v] layer\nif <(Scene #) = [1]> then\n    Spawn [costume1] At [26] [-67] Direction [90] Turn []\nend\nif <(Scene #) = [101]> then\n    Spawn [costume2] At [21] [126] Direction [90] Turn []\nend\nif <(Scene #) = [102]> then\n    Spawn [costume3] At [-58] [60] Direction [90] Turn []\n    Spawn [costume6] At [-173] [-150] Direction [90] Turn []\nend\nif <(Scene #) = [5]> then\n    Spawn [Key 1] At [24] [30] Direction [90] Turn []\nend\nif <(Scene #) = [0]> then\n    Spawn [costume4] At [65] [15] Direction [90] Turn []\n    Spawn [costume4] At [-57.5] [45] Direction [90] Turn []\n    Spawn [costume4] At [-180] [75] Direction [90] Turn []\nend\nif <(Scene #) = [-1]> then\n    Spawn [Cross] At [0] [0] Direction [90] Turn [2]\n    Spawn [Key 2] At [-147] [-25] Direction [90] Turn []\nend\nif <(Scene #) = [198]> then\n    Spawn [Key 3] At [192] [56] Direction [90] Turn []\nend\nif <(Scene #) = [99]> then\n    Spawn [Square] At [-115] [-72] Direction [90] Turn [3]\n    Spawn [Square] At [2] [13] Direction [90] Turn [3]\nend\nif <(Scene #) = [202]> then\n    Spawn [Key 4] At [198] [78] Direction [90] Turn []\nend\nif <(Scene #) = [106]> then\n    Spawn [costume5] At [-190] [-141] Direction [90] Turn []\n    Spawn [Cross2] At [20] [0] Direction [90] Turn [4]\nend\n\ndefine Animate 1\nshow\nswitch costume to (costume1 v)\nforever\n    glide (1.5) secs to x: (26) y: (100)\n    wait (0.7) seconds\n    glide (1.5) secs to x: (26) y: (-67)\n    wait (0.7) 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 <(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) > (Last Y)> then\n        change y by (1)\n    else\n        change y by ((Last Y) + (1))\n    end\n    if <touching (player v)?> then\n        set [platform dx v] to ((new x) - (Last X))\n        set [platform dy v] to ((new y) - (Last Y))\n    end\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate 2\nshow\nswitch costume to (costume2 v)\nforever\n    glide (1) secs to x: (21) y: (65)\n    wait (0.5) seconds\n    glide (1) secs to x: (21) y: (126)\n    wait (0.5) seconds\nend\n\ndefine Animate 3\nshow\nswitch costume to (costume3 v)\nforever\n    glide (1) secs to x: (72) y: (60)\n    wait (0.5) seconds\n    glide (1) secs to x: (-58) y: (60)\n    wait (0.1) seconds\nend\n\ndefine Door At (x) (y) Key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        play sound [Buzz Whir v] until done\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        play sound [Buzz Whir v] until done\n        repeat (24)\n            change y by (-4)\n        end\n        play sound [Crunch v] until done\n    else\n        play sound [Low Squeak v] until done\n    end\n    wait until <not <touching (player v)?>>\nend\n\ndefine Animate 4\nshow\nswitch costume to (costume4 v)\nforever\n    glide (1) secs to x: (x position) y: ((y position) - (90))\n    wait (0) seconds\n    glide (1) secs to x: (x position) y: ((y position) + (90))\n    wait (0) seconds\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine Spawn (type) At (x) (y) Direction (direction) Turn (degrees)\nset [turn v] to (degrees)\ngo to x: (x) y: (y)\npoint in direction (direction)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif < (costume [name v]) contains [Key]?> then\n    Door At (x position) (y position) Key (costume [name v])\nend\nif <<(costume [name v]) = [Cross]> or <(costume [name v]) = [Cross2]>> then\n    show\n    set rotation style [all around v]\n    forever\n        turn right (Turn) degrees\n    end\nend\nif <(costume [name v]) = [Square]> then\n    show\n    set rotation style [all around v]\n    forever\n        turn right (Turn) degrees\n    end\nend\nif <(costume [number v]) = [1]> then\n    Animate 1\nend\nif <(costume [number v]) = [2]> then\n    Animate 2\nend\nif <(costume [number v]) = [3]> then\n    Animate 3\nend\nif <(costume [number v]) = [4]> then\n    Animate 4\nend\nif <(costume [number v]) = [5]> then\n    Animate 5\nend\nif <(costume [number v]) = [6]> then\n    Animate 6\nend\n\ndefine Animate 5\nshow\nswitch costume to (costume5 v)\nforever\n    glide (2) secs to x: (-190) y: (-141)\n    wait (0.5) seconds\n    glide (1) secs to x: (-190) y: (66)\n    wait (0) seconds\nend\n\ndefine Animate 6\nshow\nswitch costume to (costume6 v)\nforever\n    glide (2) secs to x: (-173) y: (-150)\n    wait (0) seconds\n    glide (2) secs to x: (-173) y: (70)\n    wait (0.5) seconds\nend\n\n@Collectables\n\nwhen I receive [change scene v]\nif <(Scene #) = (MY SCENE)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nrepeat until <touching (player v)?>\n    change y by ((0.5) * ([sin v] of (Frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [coin]> then\n    start sound [Wand v]\n    change [coins v] by (1)\nend\nif <(costume [name v]) = [bigcoin]> then\n    start sound [Wand v]\n    change [coins v] by (3)\nend\nif < (costume [name v]) contains [Key]?> then\n    start sound [Wand v]\n    add (costume [name v]) to [collected v]\nend\nif <(costume [name v]) = [checkpoint]> then\n    start sound [Wand 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])\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [setup v]\ndelete all of [collected v]\nset [coins v] to [0]\nset [frame v] to [0]\nhide\nPlace [checkpoint] Scene [-2] xy [109] [12]\nPlace [coin] Scene [-2] xy [-89] [86]\nPlace [Key 2] Scene [-1] xy [-6] [123]\nPlace [coin] Scene [-1] xy [167] [-96]\nPlace [coin] Scene [0] xy [113] [108]\nPlace [coin] Scene [0] xy [-163] [-92]\nPlace [coin] Scene [1] xy [-40] [127]\nPlace [coin] Scene [2] xy [186] [-61]\nPlace [checkpoint] Scene [3] xy [-168] [-51]\nPlace [bigcoin] Scene [5] xy [56] [-43]\nPlace [coin] Scene [98] xy [-92] [97]\nPlace [bigcoin] Scene [99] xy [163] [-116]\nPlace [Key 3] Scene [99] xy [159] [106]\nPlace [coin] Scene [101] xy [-41] [-106]\nPlace [coin] Scene [101] xy [188] [-108]\nPlace [coin] Scene [102] xy [23] [103]\nPlace [Key 1] Scene [102] xy [178] [-34]\nPlace [coin] Scene [103] xy [-147] [19]\nPlace [checkpoint] Scene [103] xy [215] [89]\nPlace [coin] Scene [104] xy [116] [74]\nPlace [bigcoin] Scene [106] xy [174] [-119]\nPlace [Key 4] Scene [106] xy [7] [110]\nPlace [checkpoint] Scene [198] xy [-165] [45]\nPlace [coin] Scene [198] xy [90] [45]\nPlace [coin] Scene [199] xy [-78] [41]\nPlace [coin] Scene [199] xy [-179] [-75]\nPlace [checkpoint] Scene [200] xy [-118] [39]\nPlace [coin] Scene [201] xy [-118] [39]\nPlace [coin] Scene [201] xy [-37] [39]\nPlace [coin] Scene [201] xy [44] [39]\n\ndefine Place (costume name) Scene (scene) xy (x) (y)\nset [my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nwhen I receive [reset game v]\ndelete this clone\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [change scene v]\nif <(Scene #) = [1]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [206] [44] Direction [-90]\n    else\n        Spawn [Red] At [-145] [-64] Direction [-90]\n    end\nend\nif <(Scene #) = [0]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [192] [-74] Direction [-90]\n    else\n        Spawn [Red] At [-171] [-112] Direction [90]\n    end\nend\nif <(Scene #) = [-2]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [167] [-151] Direction [-90]\n    else\n        Spawn [Red] At [-182] [-131] Direction [-90]\n    end\nend\nif <(Scene #) = [101]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [-20] [28] Direction [-90]\n    else\n        Spawn [Red] At [-97] [26] Direction [-90]\n    end\nend\nif <(Scene #) = [99]> then\n    Spawn [Red] At [184] [-139] Direction [-90]\nend\nif <(Scene #) = [198]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [154] [25] Direction [-90]\n    else\n        Spawn [Red] At [-183] [25] Direction [-90]\n    end\nend\nif <(Scene #) = [3]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [215] [-65] Direction [-90]\n        Spawn [Red] At [50] [141] Direction [-90]\n    else\n        Spawn [Red] At [-185] [-65] Direction [-90]\n        Spawn [Red] At [-193] [141] Direction [-90]\n    end\nend\nif <(Scene #) = [4]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] At [189] [61] Direction [-90]\n    else\n        Spawn [Red] At [-141] [-65] Direction [-90]\n    end\nend\nif <(Scene #) = [104]> then\n    Spawn [Red] At [-120] [-109] Direction [-90]\nend\n\nwhen I start as a clone\nshow\nset [speed y v] to [0]\nset [frame v] to [0]\nforever\n    switch costume to (red1 v)\n    set rotation style [don't rotate v]\n    Move - Left and Right\n    Move - Down\n    change [frame v] by (0.33)\n    switch costume to ((1) + (([floor v] of (Frame) ) mod (4)))\n    set rotation style [left-right v]\n    if <<touching (player v)?> and <(INVULNERABLE) = [0]>> then\n        Touching Player\n    end\nend\n\nwhen I receive [about to change 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 platform v)?>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine Move - Left and Right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (_edge_ v)?> or <touching (level v)?>>> then\n        if <not <<touching (safe zones v)?> or <touching (platform v)?>>> then\n            if <not <touching (jump through platform v)?>> then\n                stop [this script v]\n            end\n        end\n    end\n    change y by (1)\nend\nchange y by (-4)\nmove (-2) steps\nturn right (180) degrees\n\ndefine Touching Player\nif <([speed y v] of [player v]) < [-3]> then\n    broadcast (Player Bounce v)\n    start sound [Squish Pop v]\n    switch costume to (red squash v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nbroadcast (Lose Life v)\n\ndefine Spawn (type) At (x) (y) Direction (direction)\ngo to x: (x) y: (y)\npoint in direction (direction)\ncreate clone of (_myself_ v)\n\n@Safe Zones\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\n\n@Shop Icon\n\nwhen I receive [start game v]\ngo to x: (167) y: (-143)\nshow\n\nwhen this sprite clicked\nhide\nbroadcast (Open Shop v)\n\nwhen flag clicked\nhide\n\nwhen [space v] key pressed\nshow\n\n@Shop Background\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [astronaut costume v] to []\nset [peach costume v] to []\nset [lime costume v] to []\n\nwhen I receive [open shop v]\nshow\n\nwhen [space v] key pressed\nhide\n\n@Astronaut Cat\n\nwhen flag clicked\ngo to x: (-155) y: (17)\nhide\n\nwhen this sprite clicked\nif <<(COINS) > [10]> or <(COINS) = [10]>> then\n    if <(Astronaut Costume) = [BOUGHT]> then\n        broadcast (ALREADY BOUGHT v)\n    else\n        broadcast (Astronaut Costume Bought v)\n        change [coins v] by (-10)\n        switch costume to (costume2 v)\n        set [astronaut costume v] to [BOUGHT]\n    end\nelse\n    broadcast (NOT ENOUGH COINS v)\nend\n\nwhen [space v] key pressed\nhide\n\nwhen I receive [open shop v]\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\n\n@Peach Cat\n\nwhen [space v] key pressed\nhide\n\nwhen this sprite clicked\nif <<(COINS) > [15]> or <(COINS) = [15]>> then\n    if <(Peach Costume) = [BOUGHT]> then\n        broadcast (ALREADY BOUGHT v)\n    else\n        broadcast (Peach Costume Bought v)\n        change [coins v] by (-15)\n        switch costume to (costume2 v)\n        set [peach costume v] to [BOUGHT]\n    end\nelse\n    broadcast (NOT ENOUGH COINS v)\nend\n\nwhen flag clicked\ngo to x: (-5) y: (17)\nhide\n\nwhen I receive [open shop v]\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\n\n@Lime Cat\n\nwhen [space v] key pressed\nhide\n\nwhen this sprite clicked\nif <<(COINS) > [20]> or <(COINS) = [20]>> then\n    if <(Lime Costume) = [BOUGHT]> then\n        broadcast (ALREADY BOUGHT v)\n    else\n        broadcast (Lime Costume Bought v)\n        change [coins v] by (-20)\n        switch costume to (costume2 v)\n        set [lime costume v] to [BOUGHT]\n    end\nelse\n    broadcast (NOT ENOUGH COINS v)\nend\n\nwhen flag clicked\ngo to x: (146) y: (17)\nhide\n\nwhen I receive [open shop v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\n@CANNOT BUY\n\nwhen flag clicked\nhide\n\nwhen I receive [not enough coins v]\nswitch costume to (not enough coins v)\nshow\ngo to [front v] layer\nwait (3) seconds\nhide\n\nwhen I receive [already bought v]\nswitch costume to (already purchased v)\nshow\ngo to [front v] layer\nwait (3) seconds\nhide\n\n@Outro\n\nwhen I receive [outro v]\nreset timer\nforever\n    play sound [ColdPlay v] until done\nend\n\nwhen I receive [outro v]\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\ngo to [front v] layer\nswitch costume to (text v)\nset size to (100) %\nclear graphic effects\nCloneID [Tx] [-100] [50]\nCloneID [edge] [0] [0]\nCloneID [Back] [0] [0]\nCloneID [chev] [0] [0]\nCloneID [flash] [0] [0]\nCloneID [project2] [140] [-70]\nCloneID [Profile] [-100] [-70]\nCloneID [dark] [0] [0]\nCloneID [ppl] [0] [0]\n\ndefine CloneID (id) (x) (y)\ngo to x: (x) y: (y)\nset [cloneid v] to (id)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(CloneID) = [Tx]> then\n    wait (.6) seconds\n    go to x: (-100) y: (50)\n    show\n    set size to (100) %\n    go to [front v] layer\n    go [backward v] (1) layers\n    switch costume to (text v)\n    Bounce, Size: [100] Speed: [5]\nend\n\nwhen I start as a clone\nif <(CloneID) = [edge]> then\n    wait until <(timer) > [1.1]>\n    show\n    set size to (100) %\n    switch costume to (border v)\n    set [ghost v] effect to (60)\n    set [brightness v] effect to (-40)\nend\n\nwhen I start as a clone\nif <(CloneID) = [Back]> then\n    wait (1.1) seconds\n    show\n    set size to (100) %\n    go [backward v] (2) layers\n    switch costume to (dark v)\n    set [brightness v] effect to (-40)\nend\n\nwhen I start as a clone\nif <(CloneID) = [chev]> then\n    show\n    set size to (100) %\n    switch costume to (chevs  v)\n    go [backward v] (2) layers\n    set [brightness v] effect to (0)\n    forever\n        repeat (21)\n            switch costume to (size heck v)\n            change y by ((10) + (((100) - (y position)) / (9)))\n            switch costume to (chevs  v)\n        end\n        set y to (0)\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [flash]> then\n    wait (1.1) seconds\n    show\n    set size to (100) %\n    switch costume to (back v)\n    go to [front v] layer\n    set [brightness v] effect to (100)\n    set [ghost v] effect to (0)\n    forever\n        set [ghost v] effect to (0)\n        repeat (40)\n            change [ghost v] effect by (3)\n        end\n        repeat (3)\n            set [ghost v] effect to (0)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n        end\n        wait (.5) seconds\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [Tx]> then\n    wait (2.5) seconds\n    forever\n        repeat (10)\n            turn right (12) degrees\n        end\n        repeat (25)\n            turn right (((90) - (direction)) / (15)) degrees\n        end\n        \n            turn right (((90) - (direction)) / (15)) degrees\n        end\n        point in direction (90)\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [Tx]> then\n    wait (1.1) seconds\n    show\n    set size to (100) %\n    switch costume to (text v)\n    go to [front v] layer\n    wait (3) seconds\n    forever\n        Bounce size [100] [5]\n        wait (1.93) seconds\n    end\nend\n\ndefine Bounce size (size) (spd)\nset [soft v] to [0]\nset size to (170) %\nrepeat (30)\n    set [soft v] to (((soft) * (0.7)) + (((size) - (size)) / (spd)))\n    change size by (soft)\nend\n\nwhen I start as a clone\nif <(CloneID) = [profile]> then\n    wait until <(timer) > [4.5]>\n    go to x: (-110) y: (-70)\n    show\n    set size to (100) %\n    switch costume to (profile v)\n    set [brightness v] effect to (0)\n    wait (1.3) seconds\n    forever\n        Bounce size [100] [5]\n        wait (1.93) seconds\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [profile]> then\n    wait until <(timer) > [4.]>\n    go to x: (-110) y: (-70)\n    show\n    set size to (100) %\n    switch costume to (profile v)\n    set [brightness v] effect to (0)\n    wait (.2) seconds\n    Bounce size [100] [5]\nend\n\nwhen I start as a clone\nif <(CloneID) = [project2]> then\n    wait until <(timer) > [4.5]>\n    show\n    set size to (100) %\n    switch costume to (project v)\n    set [brightness v] effect to (0)\n    wait (1.1) seconds\n    forever\n        Bounce size [100] [5]\n        wait (1.93) seconds\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [project2]> then\n    wait until <(timer) > [4.]>\n    show\n    set size to (100) %\n    switch costume to (project v)\n    set [brightness v] effect to (0)\n    Bounce size [100] [5]\nend\n\nwhen I start as a clone\nif <(CloneID) = [project2]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            hide list [project #1 v]\n            set [dark? v] to [yes]\n        else\n            show list [project #1 v]\n            wait until <not <touching (mouse-pointer v)?>>\n            set [dark? v] to [no]\n        end\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [dark]> then\n    show\n    switch costume to (dark v)\n    set [ghost v] effect to (100)\n    forever\n        go to [front v] layer\n        if <<(Dark?) = [yes]> or <(Dark#2) = [yes]>> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (100)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(CloneID) = [shockwave]> then\n    wait until <(timer) > [.6]>\n    show\n    go to [front v] layer\n    go [backward v] (2) layers\n    go to x: (0) y: (0)\n    switch costume to (shock wave v)\n    clear graphic effects\n    set [n v] to [12]\n    repeat (26)\n        change [fisheye v] effect by (n)\n        change [n v] by ((n) * (0.5))\n        change size by (((200) - (size)) / (7))\n    end\n    delete this clone\nend\n\ndefine Bounce, Size: (s) Speed: (spd)\nset [bounce v] to [0]\nset size to (200) %\nrepeat (30)\n    set [bounce v] to (((Bounce) * (0.7)) + (((s) - (size)) / (spd)))\n    change size by (Bounce)\nend\n\nwhen I start as a clone\nif <(CloneID) = [ppl]> then\n    wait (1.1) seconds\n    switch costume to (ppl v)\n    show\n    set size to (100) %\n    go to x: (0) y: (0)\nend\n\nwhen I start as a clone\nif <(CloneID) = [ppl]> then\n    point in direction (90)\n    forever\n        switch costume to (ppl v)\n        point in direction (((([sin v] of (((timer) / (2)) * ((200) / (2))) ) * ((15) / (2))) + ((90) / (2))) * (2))\n    end\nend\n\nwhen I receive [outro v]\ndelete all of [project #1 v]\nshow list [project #1 v]\nadd [\(Insert Name\)] to [project #1 v]\nadd [\(Insert link\)] to [project #1 v]\nadd [Triple Click ⬆️] to [project #1 v]\n\n
                Welcome To My Classic Platformer\n               ❤️ + ⭐️ + Follow IF YOU ENJOY!\n\n                     ON TRENDING - 27/10/23!!!\n\nWARNING: \n- This game is a bit glitchy so click the green flag several times! \n- Full-screen recommended!\n- Turbowarp: https://turbowarp.org/882101669\n\nInstructions:\nArrow keys for controls.\nDon't get crashed or hit by platforms.\nKill the enemies by jumping on them.\nCollect the keys to open the doors.\nCollect coins and save up to buy costumes!\nDon't lose all your lives, because otherwise you will die.\nAlso check out the shop (icon on the bottom right) to buy new costumes. (there seems to be a bug in code for the costumes, but it will be fixed soon!)\nWin the game by opening the cyan door.\n\nHint (if you're really stuck): Explore everything on the right of your spawnpoint first and collect the cyan key. Then get back to your spawn point and explore everything on the left of there and you'll be on the right track to winning!\n\nGO CHECK OUT MY STUDIO FOR THIS PROJECT: https://scratch.mit.edu/studios/3407376