Platformer
@Stage\n\nset [scene # v] to [115]\nbroadcast (Changing Scene v)\n\nset [lives v] to [1]\n\nbroadcast (About to Change Scene v)\n\nbroadcast (Game Over v)\n\nbroadcast (Layering v)\n\nbroadcast (LOAD v)\n\nbroadcast (Lose Life v)\n\nbroadcast (Main Menu v)\n\nbroadcast (Player Bounce v)\n\nbroadcast (Set Up v)\n\nbroadcast (START SONG v)\nbroadcast (song wait v)\n\nbroadcast (Start Game v)\n\n@Blank\n\nwhen flag clicked\nset [song v] to [1]\nset volume to (100) %\nforever\n    if <(SONG) = [0]> then\n        wait (0.000000001) seconds\n        stop all sounds\n        clear sound effects\n        set volume to (0) %\n    end\nend\n\nwhen flag clicked\nforever\n    if <(SONG) = [0]> then\n        stop all sounds\n        clear sound effects\n        set volume to (0) %\n    end\nend\n\nbroadcast (song wait v)\n\nwhen I receive [song wait v]\nwait (0.000000002) seconds\nif <(SONG) = [1]> then\n    repeat (36)\n        if <(SONG) = [1]> then\n            wait (1) seconds\n        end\n    end\n    if <(SONG) = [1]> then\n        wait (0.7) seconds\n    end\nend\n\nwhen I receive [start song v]\nwait (0.1) seconds\nrepeat until <(SONG) = [0]>\n    set volume to (100) %\n    start sound [Sh0-t0's song v]\n    broadcast (song wait v) and wait\nend\n\n\n\nwhen flag clicked\nbroadcast (START SONG v)\n\n@Player\n\nwhen flag clicked\nset [cat status v] to [0]\nhide variable [jump force v]\nset [lives v] to [3]\nset [scene # v] to [1]\nset [apples v] to [0]\nbroadcast (Main Menu v)\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 <(Touching00) > [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 <(Touching00) > [0]> then\n        Collide Y Ceiling or floor?\n    end\nend\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (platform v)?>> then\n    set [touching00 v] to [1]\n    stop [this script v]\nend\nset [touching00 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 (jumpthrough v)?> then\n    if <(jumpthrough) < [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 (jumpthrough v)?> then\n            set [touching00 v] to [1]\n        else\n            set [jumpthrough v] to [1]\n        end\n        change y by (6)\n    end\nelse\n    set [jumpthrough 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-Up and Down\nif <<(STICK BUTTON) > [0]> or <<key (up arrow v) pressed?> or <(STICK Y) = [1]>>> then\n    if <<(wall slide) > [0]> and <(Jumping) = [0]>> then\n        if <(SONG) = [1]> then\n            start sound [Jump v]\n        end\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        if <(SONG) = [1]> then\n            start sound [Jump v]\n        end\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(Jumping) > [0]> and <(Jumping) < (Jump Duration)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (Jump force)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (Gravity)\nif <(wall slide) > [0]> then\n    Check Can Wall Slide\n    if <(Speed y) < [0]> then\n        set [speed y v] to ((Speed y) * (0.6))\n    end\nend\n\ndefine Controls-Left and Right\nset [key x v] to (STICK X)\nif <(LONG JUMP) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nif <([abs v] of (STICK X) ) < [0.3]> 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 Reser 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 [long jump v] to [0]\nset [jumping v] to [0]\nset [wall slide v] to [0]\nBegin Scene # (SPAWN SCENE) go to x,y: (Spawn X) (Spawn Y)\npoint in direction (90)\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick First v)\n    broadcast (Tick Platform 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: [] [-180]\nend\nif <(y position) < [-180]> then\n    Begin Scene # ((Scene #) + (-100)) go to x,y: [] [180]\nend\nif <touching (danger v)?> 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 (About to Change Scene v)\nbroadcast (Changing 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 with Direction [0]\nelse\n    Fix Collision with Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collision with Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (1000)\n    Check Touching Solid\n    if <(Touching00) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(Speed y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Solid\n        if <(Touching00) < [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 <(Touching00) > [0]> then\n    change y by (1)\n    Check Touching Solid\n    if <(Touching00) > [0]> then\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 <(Touching00) < [1]> then\n    set [falling v] to [9]\n    set [speed x v] to [0]\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching Solid\nif <(Touching00) < [1]> then\n    set [falling v] to [9]\n    set [speed x v] to [-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 (Touching00)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [lose life v]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nrepeat (10)\n    if <(SONG) = [1]> then\n        start sound [Oops v]\n    end\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(LIVES) > [0]> then\n    Reser 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 <(Touching00) > [0]> then\n    Find closest space to (x position) (y position) max [16]\n    if <(Touching00) > [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 <(Touching00) < [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\nwhen I receive [start game v]\nset [apples v] to [0]\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 (Set Up v) and wait\nset [lives v] to [3]\nset [spawn scene v] to [1]\nset [spawn x v] to [-150]\nset [spawn y v] to [55]\nReser and Begin Level\n\nwhen I receive [player bounce v]\nset [speed y v] to [10]\n\nif <(MOBILE?) = [NO]> then\n    set [key x v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n    if <(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\n    else\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)\n    end\n    set [speed x v] to ((Speed x) * (Resistance))\nend\n\nwhen I receive [boost v]\nshow variable [jump force v]\nstop [this script v]\n\nwhen flag clicked\nrepeat (10)\n    set [colour v] to [0]\nend\nforever\n    set [color v] effect to (COLOUR)\nend\n\nwhen I receive [start game v]\nif <(CAT STATUS) = [1]> then\n    broadcast (Glasses v)\nend\n\nwhen I receive [start game v]\nforever\n    set [color v] effect to (COLOUR)\nend\n\nwhen I receive [game over v]\nforever\n    set [color v] effect to (COLOUR)\nend\n\nwhen I receive [stop v]\nset [gravity v] to [0]\nwait (0.5) seconds\nset [gravity v] to [-1.5]\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nbroadcast (Layering v)\n\nwhen I receive [changing 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 (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 I receive [about to change scene v]\nerase all\n\n@Jumpthrough\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nbroadcast (Layering v)\n\nwhen I receive [changing 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 (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\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (5) %\ngo to x: (0) y: (-70)\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 flag clicked\nhide\n\nwhen this sprite clicked\nhide\nif <not <(screen status) = [OVER]>> then\n    broadcast (LOAD v)\n    wait (pick random (1) to (3.5)) seconds\nend\nbroadcast (Start Game v)\n\nwhen I receive [start game v]\nhide\n\nwhen [timer v] > (0.0001)\nhide\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [changing scene v]\nif <(Scene #) = [2]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [-103] [-68] dir [90]\n    else\n        Spawn [Red] at [-103] [-68] dir [-90]\n    end\n    Spawn [Red] at [-103] [-68] dir [-90]\nend\nif <(Scene #) = [107]> then\n    Spawn [Red] at [-209] [-79] dir [90]\nend\nif <(Scene #) = [109]> then\n    Spawn [Red] at [45] [-51] dir [90]\nend\nif <(Scene #) = [10]> then\n    Spawn [Red] at [-128] [-89] dir [90]\nend\nif <(Scene #) = [12]> then\n    Spawn [Red] at [-96] [-91] dir [90]\nend\nif <(Scene #) = [16]> then\n    Spawn [Red] at [48] [-133] dir [-90]\n    Spawn [Red] at [-138] [-131] dir [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 <<(Invulnerable) = [0]> and <touching (player v)?>> 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 (jumpthrough 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 (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (platform v)?> or <touching (safe zones v)?>>> then\n            if <not <touching (jumpthrough 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 left (180) degrees\n\ndefine Touching Player\nif <([speed y v] of [player v]) < [-3]> then\n    broadcast (Player Bounce v)\n    if <(SONG) = [1]> then\n        start sound [Squish Pop v]\n    end\n    switch costume to (red5 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) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <touching (shield v)?> then\n        if <(SONG) = [1]> then\n            start sound [Squish Pop v]\n        end\n        broadcast (STOP v)\n        switch costume to (red5 v)\n        repeat (2)\n            change [ghost v] effect by (50)\n        end\n        delete this clone\n    end\nend\n\nbroadcast (About to Change Scene v)\nbroadcast (Player Bounce v)\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 [changing scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\n\n@HEALTH BAR\n\nwhen flag clicked\nhide\nforever\n    SPPED FOLLOW\nend\n\nwhen I receive [start game v]\nshow\n\ndefine SPPED FOLLOW\ngo to [front v] layer\nif <touching (player v)?> then\n    go [backward v] (1) layers\nelse\n    go to [front v] layer\nend\nif <(LIVES) = [3]> then\n    switch costume to (3 v)\nelse\n    if <(LIVES) = [2]> then\n        switch costume to (2 v)\n    else\n        if <(LIVES) = [1]> then\n            switch costume to (1 v)\n        else\n            switch costume to (0 v)\n        end\n    end\nend\n\nwhen I receive [game over v]\nhide\n\nwhen [timer v] > (0.0001)\nhide\n\ngo to (player v)\nchange y by (35)\n\ndefine FOLLOWING THE CAT\ngo to x: ([x position v] of [player v]) y: (([y position v] of [player v]) + (35))\n\nwhen flag clicked\nforever\n    FOLLOWING THE CAT\nend\n\ngo to (player v)\nchange y by (35)\n\n@Danger\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [changing scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\nSTAMP OUTLINE\nSTAMP SHADOW\nif <<(Scene #) = [107]> or <<<(Scene #) = [3]> or <(Scene #) = [5]>> or <<(Scene #) = [116]> or <(Scene #) = [13]>>>> then\n    forever\n        repeat (10)\n            change y by (0.1)\n        end\n        wait (0.01) seconds\n        repeat (10)\n            change y by (-0.1)\n        end\n    end\nend\ngo to x: (0) y: (0)\n\nset y to ((5) * ([sin v] of (() * (360)) ))\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\n@Collectables\n\nwhen I receive [changing 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]) = [apple]> then\n    if <(SONG) = [0]> then\n        change [apples v] by (1)\n    else\n        start sound [Chomp v]\n        change [apples v] by (1)\n    end\nelse\n    if <(costume [name v]) = [Green Flag]> then\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        if <(SONG) = [0]> then\n        else\n            start sound [Wand v]\n        end\n    else\n        if <(SONG) = [0]> then\n            add (costume [name v]) to [collected v]\n        else\n            add (costume [name v]) to [collected v]\n            start sound [Wand v]\n        end\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [set up v]\ndelete all of [collected v]\nset [frame v] to [0]\nset [apples v] to [0]\nhide\nPlace [apple] scene [1] xy [-53] [-54]\nPlace [apple] scene [1] xy [7] [-54]\nPlace [apple] scene [2] xy [198] [-54]\nPlace [apple] scene [2] xy [150] [-54]\nPlace [apple] scene [3] xy [-80] [-42]\nPlace [apple] scene [4] xy [-58] [-47]\nPlace [apple] scene [4] xy [115] [-47]\nPlace [apple] scene [5] xy [-89] [-11]\nPlace [apple] scene [5] xy [161] [-11]\nPlace [apple] scene [6] xy [161] [-11]\nPlace [apple] scene [6] xy [23] [-72]\nPlace [apple] scene [7] xy [-29] [42]\nPlace [apple] scene [7] xy [146] [138]\nPlace [apple] scene [7] xy [151] [48]\nPlace [apple] scene [8] xy [-82] [-12]\nPlace [Key 1] scene [107] xy [-172] [-66]\nPlace [Green Flag] scene [5] xy [40] [48]\nPlace [Green Flag] scene [8] xy [109] [118]\nPlace [Key 2] scene [111] xy [-151] [-28]\nPlace [apple] scene [109] xy [198] [-50]\nPlace [apple] scene [110] xy [84] [-65]\nPlace [apple] scene [110] xy [84] [-144]\nPlace [apple] scene [10] xy [198] [-79]\nPlace [apple] scene [13] xy [20] [0]\nPlace [Green Flag] scene [14] xy [76] [-111]\nPlace [Green Flag] scene [11] xy [13] [17]\nPlace [Key 3] scene [115] xy [107] [-14]\nPlace [Green Flag] scene [17] xy [72] [-123]\nPlace [apple] scene [115] xy [177] [57]\nPlace [apple] scene [16] xy [27] [64]\nPlace [apple] scene [16] xy [27] [-29]\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\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\n@Platform\n\nwhen I receive [changing scene v]\nhide\nif <(Scene #) = [3]> then\n    Spawn [costume1] at [-135] [-74] dir [90] turn []\nend\nif <(Scene #) = [8]> then\n    Spawn [Key 1] at [40] [-48] dir [90] turn []\nend\nif <(Scene #) = [12]> then\n    Spawn [Key 2] at [206] [-63] dir [90] turn []\nend\nif <(Scene #) = [13]> then\n    Spawn [costume2] at [13] [-86] dir [90] turn [1]\nend\nif <(Scene #) = [16]> then\n    Spawn [Key 3] at [197] [-104] dir [90] turn [1]\nend\n\ndefine Animate Platform\nshow\nswitch costume to (costume1 v)\npoint in direction (90)\nforever\n    glide (2) secs to x: ((x position) + (170)) y: (y position)\n    wait (1) seconds\n    glide (2) secs to x: ((x position) - (170)) y: (y position)\n    wait (1) seconds\nend\n\nwhen I receive [tick platform 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        set y to ((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 (key name)\nshow\nswitch costume to (key name)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        if <(SONG) = [0]> then\n            repeat (24)\n                change y by (2)\n            end\n            wait (1) seconds\n            repeat (24)\n                change y by (-2)\n            end\n        else\n            start sound [Buzz Whir v]\n            repeat (24)\n                change y by (2)\n            end\n            wait (1) seconds\n            start sound [Buzz Whir v]\n            repeat (24)\n                change y by (-2)\n            end\n            start sound [Crunch v]\n        end\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\ndefine Animate Platform 2\nshow\npoint in direction (90)\nswitch costume to (costume1 v)\nforever\n    glide (2) secs to x: ((x position) + (235)) y: (y position)\n    wait (0) seconds\n    glide (2) secs to x: ((x position) - (235)) y: (y position)\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) dir (dir) turn (degrees)\nset [turn v] to (degrees)\nswitch costume to (type)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif < (costume [name v]) contains [Key]?> then\n    (costume [name v])\nend\nif <(Turn) > []> then\n    show\n    set rotation style [all around v]\n    forever\n        turn right (Turn) degrees\n    end\nend\nAnimate 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\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\n@Splash Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (main menu v)\ngo to [front v] layer\nshow\nwait (1) seconds\n\nwhen I receive [game over v]\ngo to x: (0) y: (0)\nswitch costume to (game over v)\ngo to [front v] layer\nshow\nbroadcast (Main Menu v)\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [layering v]\ngo to [front v] layer\n\nwhen flag clicked\nshow list [other games v]\nshow list [alt v]\ndelete all of [alt v]\ndelete all of [other games v]\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.0001)\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nswitch costume to (stopped v)\nshow\nhide list [alt v]\nhide list [other games v]\nwait (0.1) seconds\nadd [Da1-t0 : https://scratch.mit.edu/users/Da1-t0/] to [alt v]\nwait (0.1) seconds\nadd [https://scratch.mit.edu/projects/783243751/] to [other games v]\nwait (0.1) seconds\nadd [https://scratch.mit.edu/projects/754805464/] to [other games v]\nwait (0.1) seconds\nadd [https://scratch.mit.edu/projects/753112903/] to [other games v]\nwait (0.1) seconds\nadd [https://scratch.mit.edu/projects/740703769/] to [other games v]\nwait (0.1) seconds\nadd [If you enjoyed this game make sure to follow me, ] to [other games v]\nwait (0.1) seconds\nadd [so you know when the next game is out!] to [other games v]\n\nwhen flag clicked\ndelete this clone\n\nwhen I start as a clone\nshow\nswitch costume to (arrow v)\ngo to x: (0) y: (100)\nforever\n    repeat (20)\n        change y by (1)\n    end\n    go to [front v] layer\n    repeat (20)\n        change y by (-1)\n    end\nend\n\nwhen [timer v] > (0.0001)\n\nwhen I receive [load v]\nrepeat until <(screen status) = [GAME]>\n    switch costume to (main menu1 v)\n    wait (0.5) seconds\n    switch costume to (main menu2 v)\n    wait (0.5) seconds\n    switch costume to (main menu3 v)\n    wait (0.5) seconds\n    switch costume to (main menu v)\n    wait (0.5) seconds\nend\n\n@Numbers\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I start as a clone\nshow\nforever\n    change costume to (join [Glow-] (letter (index) of (Apples)))\n    set x to ((((index) - (0.5)) - ((length of (Apples)) / (2))) * ((size) / (2)))\n    change size by ((0.2) * ((100) - (size)))\n    if <touching (player v)?> then\n        go [backward v] (1) layers\n    else\n        go to [front v] layer\n    end\nend\n\ndefine setup\nchange [☁ views v] by (1)\nhide\nswitch costume to (glow-9 v)\nset size to (100) %\ngo to x: (0) y: (132)\nset [index v] to [1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change x by ((size) / (2))\n    change [index v] by (1)\nend\n\ndefine change costume to (costume)\nif <not <(costume) = (costume [name v])>> then\n    switch costume to (costume)\n    set size to (120) %\nend\n\nwhen I receive [start game v]\nsetup\n\nset x to ((((index) - (0.5)) - ((length of (Apples)) / (2))) * ((size) / (2)))\n\nif <touching (player v)?> then\n    go [backward v] (1) layers\nelse\n    go to [front v] layer\nend\n\n@Stick\n\nwhen flag clicked\ngo to [front v] layer\nset size to (80) %\nset [ghost v] effect to (80)\nset [range v] to ((size) / (2.5))\nforever\n    if <(MOBILE?) = [YES]> then\n        show\n        switch costume to (base v)\n        go to x: (-174) y: (-118)\n        if <(distance to [mouse-pointer v]) < (size)> then\n            STICK ACTIVATED\n        end\n    else\n        hide\n        repeat until <not <mouse down?>>\n            KEYBOARD CONTROLS\n        end\n        repeat until <mouse down?>\n            KEYBOARD CONTROLS\n        end\n    end\nend\n\ndefine KEYBOARD CONTROLS\nset [stick x v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nchange [stick x v] by ((0) - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nset [stick y v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nchange [stick y v] by ((0) - <<key (down arrow v) pressed?> or <key (s v) pressed?>>)\nif <key (space v) pressed?> then\n    change [stick button v] by (1)\nelse\n    set [stick button v] to [0]\nend\n\ndefine STICK ACTIVATED\ngo to (mouse-pointer v)\nswitch costume to (ready v)\ncreate clone of (_myself_ v)\nswitch costume to (stick v)\ncreate clone of (_myself_ v)\nswitch costume to (baseactive v)\nset [stick button v] to []\nrepeat until <(distance to [mouse-pointer v]) > ((size) * (1.5))>\n    DETECT STICK MOVEMENT\n    DETECT STICK BUTTON\nend\nbroadcast (Deactivate Stick v)\n\ndefine DETECT STICK MOVEMENT\nset [stick x v] to (((mouse x) - (x position)) / (range))\nset [stick y v] to (((mouse y) - (y position)) / (range))\nif <([abs v] of (STICK X) ) > [1]> then\n    set [stick x v] to ((STICK X) / ([abs v] of (STICK X) ))\nend\nif <([abs v] of (STICK Y) ) > [1]> then\n    set [stick x v] to ((STICK Y) / ([abs v] of (STICK Y) ))\nend\n\ndefine DETECT STICK BUTTON\nif <mouse down?> then\n    if <(STICK BUTTON) > []> then\n        change [stick button v] by (1)\n    end\nelse\n    set [stick button v] to [0]\nend\n\nwhen I receive [deactivate stick v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [name v]) = [Stick]> then\n    go [forward v] (1) layers\n    set [ghost v] effect to (0)\n    forever\n        go to (stick v)\n        change x by ((STICK X) * (range))\n        change y by ((STICK Y) * (range))\n        go to [front v] layer\n    end\nend\ngo to x: (174) y: (-118)\nwait until <not <mouse down?>>\nswitch costume to (ready v)\nforever\n    if <mouse down?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (75)\n    end\nend\n\nwhen I receive [start game v]\nforever\n    repeat (10)\n        go to [front v] layer\n    end\n    stop [this script v]\nend\n\n@Mobile?\n\nwhen flag clicked\nset [mobile show v] to [1]\nshow\ngo to [front v] layer\nswitch costume to (no v)\ngo to x: (0) y: (-164)\nshow\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [mobile? v] to (costume [name v])\nend\n\nwhen this sprite clicked\nnext costume\nset [mobile? v] to (costume [name v])\n\nwhen I receive [start game v]\nset [mobile show v] to [0]\nhide\n\nwhen I receive [game over v]\nset [mobile show v] to [1]\nshow\n\nwhen [timer v] > (0.0001)\nset [mobile show v] to [0]\nhide\n\nwhen I receive [load v]\nhide\n\n@LOVE AND FAV FOR BOOST\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nshow\ngo to x: (141) y: (125)\nset [ghost v] effect to (0)\nwait (pick random (1) to (10)) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\nwhen flag clicked\nforever\n    if <(LOV/FAVE) = [2]> then\n        repeat (100)\n            change [ghost v] effect by (1)\n        end\n        hide\n    end\nend\n\nwhen this sprite clicked\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\n@LOVE/FAVE\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [lov/fave v] to [0]\nforever\n    set [touching v] to [none]\n    Detect [love] at [-201] [-220]\n    Detect [fave] at [-201] [-220]\nend\n\ndefine Detect (thing) at (x) (y)\nswitch costume to (empty v)\nset size to (27000) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (thing)\nif <touching (mouse-pointer v)?> then\n    set [touching v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [love]>\n    wait (0.2) seconds\n    if <(touching) = [love]> then\n        change [lov/fave v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [fave]>\n    wait (0.2) seconds\n    if <(touching) = [fave]> then\n        change [lov/fave v] by (1)\n        stop [this script v]\n    end\nend\n\n@Music\n\nwhen this sprite clicked\nif <(SONG) = [0]> then\n    broadcast (START SONG v)\nend\nnext costume\n\nwhen flag clicked\ngo to x: (-222) y: (161)\nswitch costume to (1 v)\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n    else\n        set [ghost v] effect to (70)\n    end\n    set [song v] to (costume [name v])\n    show\nend\n\n@Costume edit\n\nwhen flag clicked\nset [colour v] to [0]\nset [status v] to [1]\nshow\nset size to (100) %\ngo to x: (181) y: (-70)\nswitch costume to (front v)\ncreate clone of (_myself_ v)\ngo to x: (167) y: (-70)\nswitch costume to (back v)\ncreate clone of (_myself_ v)\ngo to x: (190) y: (-130)\nswitch costume to (loved and faved v)\ncreate clone of (_myself_ v)\nswitch costume to (stand v)\nset size to (50) %\ngo to x: ((((181) - (167)) / (2)) + (167)) y: (-70)\nswitch costume to (stand v)\nforever\n    go to [front v] layer\n    set [color v] effect to (COLOUR)\nend\n\nwhen I start as a clone\nforever\n    set [color v] effect to (0)\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            if <(costume [name v]) = [FRONT]> then\n                change [colour v] by (10)\n                set [status v] to [1]\n            else\n                if <(costume [name v]) = [BACK]> then\n                    change [colour v] by (-10)\n                    set [status v] to [1]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [special skin v]\nset [cat status v] to [1]\n\nwhen I start as a clone\nforever\n    set [color v] effect to (0)\n    if <(costume [name v]) = [LOVED AND FAVED]> then\n        if <(LOV/FAVE) > [1]> then\n            if <(screen status) = [GAME]> then\n                hide\n            else\n                show\n            end\n        else\n            hide\n        end\n        if <touching (mouse-pointer v)?> then\n            switch costume to (loved and faved2 v)\n            broadcast (Special skin v)\n        else\n            switch costume to (loved and faved v)\n        end\n    end\n    set [status v] to [0]\nend\n\nchange [color v] effect by (-5)\nchange [color v] effect by (5)\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [game over v]\nshow\nif <(costume [name v]) = [LOVED AND FAVED]> then\n    if <(LOV/FAVE) > [1]> then\n        show\n    else\n        hide\n    end\nend\n\nset [colour v] to [-40]\n\nrepeat (10)\n\nwhen flag clicked\nset [screen status v] to [MENU]\n\nwhen I receive [start game v]\nset [screen status v] to [GAME]\n\nwhen I receive [game over v]\nset [screen status v] to [OVER]\n\nrepeat until <(status) = [1]>\n    repeat (20)\n        change [colour v] by (5)\n    end\n    repeat (20)\n        change [colour v] by (-5)\n    end\nend\nset [status v] to [0]\n\nwhen [timer v] > (0.001)\nrepeat (100000000000000)\n    hide\nend\n\ngo to x: (181) y: (-70)\n\nwhen I receive [load v]\nhide\n\nswitch costume to (loved and faved2 v)\n\nif <mouse down?> then\n    repeat (10)\nend\n\n@Shield\n\nwhen flag clicked\nhide\nforever\n    FOLLOW\n    if <(CAT STATUS) = [1]> then\n        show\n        if <touching (enemy v)?> then\n            set [ghost v] effect to (20)\n            switch costume to (costume2 v)\n        else\n            set [ghost v] effect to (100)\n            switch costume to (costume1 v)\n        end\n    else\n        hide\n    end\nend\n\ndefine FOLLOW\ngo to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n\n
                        ∞---CONTROLS---∞\n \n                                  ---PC---\nArrow Keys to move. You can also use the space key to jump.\n\n                                ---MOBILE---\nClick the mobile button and use the joystick (on your left). Click the Jump button (on your right this will only appear if you are touching the joystick) to jump. To stop moving bring the joystick closer to the middle.\n\n⭐Tip: Holding the jump button longer makes you jump higher. \n\n\n                     ※---WHAT TO DO---※\nClick the Play button (if you are on mobile tick the mobile box first) and wait for the game to load. Collect apples and defeat enemies by jumping on them. Open the doors by finding the key with the same colour. You can change the cat's looks as well (you can only change at the start of the game and at the Game Over screen). If you ❤️ and ⭐(after project started) then you can get a shield (to defeat enemies) by clicking shield (this will only appear at the at the Start Screen and Game Over screen).\nWarning: Do not click the green flag and press shift at the same time.\n\n                     ⨷---Notes and Credits---⨷\n@griffpatch for Platformer tutorial and Awesome Number Counters? | Exciting Scratch Game & How to Tutorials\n\nMusic is a combination of Scratch's built in sounds and my own music/song.\n\nAround 1700 blocks.\n\nFeel free to remix.\n\n                          |---Things to fix---|\n-When music button pressed twice sound not working\n-Game is unplayable once 300 clone limit is reached\n-Scratch Cat can get stuck in wall causing player to lose life\n-If green flag clicked too fast and player clicks play too fast the loading can't be seen\n\n\nAlso follow my friends @CrazykiTten12356 and @MecuryMaster\n\n\nTested by me 100% beatable.\n\n\n#all#game#platformer#sh0-t0#Da1-t0#fun#trending #scratchcat#multitouch#mobilefriendly#mobile