☁︎Scratch cat platformer part 2☁︎
@Stage\n\nwhen flag clicked\nforever\n    play sound [Vexento - Tevo \(Original Mix\) v] until done\nend\n\n@Blank\n\n@Player\n\nwhen flag clicked\nbroadcast (Main Menu v)\nhide\n\nshow\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\nwhen I receive [next level v]\ngo to x: (-150) y: (50)\n\ndefine Check Touching Solid\nif <<<touching (level v)?> or <touching (doors v)?>> or <touching (platforms v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick-player v]\nMoved by moving platform\nswitch backdrop to <touching (level v)?>\nControls-Up and Down\nControls-Left and Right\nmove - in steps (([abs v] of (speed y) ) + ([abs v] of (speed y) ))\nSet Costume\n\ndefine Controls-Up and Down\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(STICK Y) > [0.5]>> 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\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?>> or <(STICK X) > [0.5]>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(STICK X) < [-0.5]>>)\nif <(KEY X) = [0]> then\n    if <<(Falling) > [2]> and <(Wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.9))\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\nchange [speed x v] by ((KEY X) * (ACCELERATION))\npoint in direction ((KEY X) * (90))\nchange [frame v] by (1)\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\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 [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 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 (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collisions in Direction [0]\nelse\n    Fix Collisions in Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collisions in Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(Touching) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (Distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nset [jump force v] to [15]\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- 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 flag clicked\nset size to (40) %\n\nwhen I receive [lose life v]\nswitch costume to (die v)\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nwait (1) seconds\nrepeat (40)\n    change [ghost v] effect by (2.5)\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 [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 [360]\n\nwhen flag clicked\nshow list [collected v]\n\nwhen I receive [start now! v]\nshow\nset [gravity v] to [-1.5]\nset [acceleration v] to [1.5]\nset [jump duration v] to [6]\nset [resistance v] to [0.8]\nset [jump force v] to [12]\nbroadcast (Reset Game v) and wait\nbroadcast (Setup v)\nset [lives v] to [5]\nset [spawn scene v] to [1]\nset [spawn x v] to [-150]\nset [spawn y v] to [55]\nReset and Begin Level\n\nset [lives v] to [100]\n\nwhen I receive [player - bounce v]\nset [speed y v] to [15]\n\nset [lives v] to [5]\n\nadd [Key 1] to [collected v]\n\nset [lives v] to [4]\n\nwhen flag clicked\n\nbroadcast (Start NOW! v)\n\nwhen I receive [trampoline v]\nset [speed y v] to [20]\n\nwhen flag clicked\nforever\n\nset [☁ player x v] to (x position)\nset [☁ player y v] to (y position)\n\ngo to x: (0) y: (0)\n\n@Collectable\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\nshow\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    change [apples v] by (1)\n    start sound [Collect v]\nelse\n    if <(costume [name v]) = [Green Flag]> then\n        start sound [Wand v]\n        set [spawn scene v] to (SCENE #)\n        set [spawn x v] to (x position)\n        set [spawn y v] to (y position)\n    else\n        if <(costume [name v]) = [heart]> then\n            change [lives v] by (1)\n            start sound [Wand v]\n        else\n            if <(costume [name v]) = [sword]> then\n                set [sword? v] to [1]\n                set [weapon v] to [sword]\n                start sound [Wand v]\n            else\n                if <(costume [name v]) = [BIG apple]> then\n                    start sound [Collect v]\n                    change [apples v] by (10)\n                else\n                    if <(costume [name v]) = [ninja star]> then\n                        set [ninja star? v] to [1]\n                        set [weapon v] to [ninja star]\n                        start sound [Wand v]\n                    else\n                        if <(costume [name v]) = [Key 1]> then\n                            start sound [Wand v]\n                            add (costume [name v]) to [collected v]\n                        else\n                            if <(costume [name v]) = [Key 2]> then\n                                start sound [Wand v]\n                                add (costume [name v]) to [collected v]\n                            else\n                                if <(costume [name v]) = [Key 3]> then\n                                    start sound [Wand v]\n                                    add (costume [name v]) to [collected v]\n                                else\n                                    start sound [Collect 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\nstart sound [Collect v]\n\nwhen I receive [reset game v]\ndelete all of [collected v]\nset [apples v] to [0]\nset [frame v] to [0]\nhide\nPlace [Key 1] scene [1] xy [-85] [133]\nPlace [Key 2] scene [5] xy [-41] [83]\nPlace [Key 3] scene [2] xy [44] [55]\nPlace [BIG apple] scene [205] xy [62] [62]\nPlace [apple] scene [1] xy [166] [100]\nPlace [apple] scene [2] xy [89] [-63]\nPlace [Green Flag] scene [2] xy [-70] [-27]\nPlace [sword] scene [2] xy [162] [100]\nPlace [ninja star] scene [3] xy [106] [22]\nPlace [ninja star] scene [102] xy [0] [0]\nPlace [apple] scene [3] xy [104] [-57]\nPlace [Green Flag] scene [4] xy [-8] [89]\nPlace [sword] scene [4] xy [125] [0]\nPlace [apple] scene [5] xy [115] [23]\nPlace [apple] scene [6] xy [15] [118]\nPlace [Green Flag] scene [6] xy [160] [90]\nPlace [Green Flag] scene [106] xy [-179] [-77]\nPlace [heart] scene [105] xy [0] [-25]\nPlace [Green Flag] scene [204] xy [0] [25]\nPlace [heart] scene [206] xy [11] [40]\nPlace [apple] scene [203] xy [117] [-138]\nPlace [Green Flag] scene [202] xy [14] [100]\nPlace [heart] scene [202] xy [40] [100]\nPlace [apple] scene [201] xy [-2] [-108]\nPlace [apple] scene [101] xy [-20] [114]\nPlace [apple] scene [101] xy [-20] [107]\nPlace [apple] scene [101] xy [-20] [100]\nbroadcast (Change Scene v)\n\nPlace [heart] scene [409] xy [-35] [-53]\nPlace [heart] scene [409] xy [-35] [-30]\nPlace [heart] scene [409] xy [-20] [-30]\n\nPlace [apple] scene [206] xy [191] [145]\n\nshow\n\nwhen I receive [reset game v]\ndelete this clone\n\nwhen I start as a clone\nif <touching (player v)?> then\n\nwhen I receive [start v]\ngo [backward v] (1) layers\n\nwhen flag clicked\n\nwait (5) seconds\n\nbroadcast (Start NOW! v)\n\nwhen I receive [start v]\n\nchange [lives v] by (1)\n\ngo to [front v] layer\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\nchange [apples v] by (10)\n\nset [ninja star? v] to [1]\nset [weapon v] to [ninja star]\nstart sound [Wand v]\n\nstart sound [Collect v]\n\nadd [Key 2] to [collected v]\n\nwait until <not <(costume [name v]) = [heart]>>\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 #))\nerase all\nStamp Outline\nStamp Shadow\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\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\nset [lives v] to [1000]\n\nwhen flag clicked\nswitch costume to (scene1 v)\nshow list [scores v]\n\nwhen flag clicked\nset [☁ timer v] to [0]\n\nforever\n\nset [lives v] to [9999999]\n\nwhen I receive [start now! v]\ninsert (join (join (username) [ : ]) (☁ TIMER)) at (1) of [scores v] \n\nforever\nend\n\nif <not <(SCENE #) = [7]>> then\n    wait (1) seconds\n    change [☁ timer v] by (1)\nend\nif <(SCENE #) = [7]> then\n    stop [other scripts in sprite v]\n    wait (1.5) seconds\n    hide list [scores v]\n    stop [all v]\nend\n\nwhen I receive [reset game v]\nset [☁ timer v] to [0]\n\nset [scene # v] to [308]\n\nhide\n\nwhen flag clicked\nshow\n\n@Doors\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 (30)\n            change y by (4)\n        end\n        wait (4) seconds\n        start sound [Buzz Whir v]\n        repeat (30)\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\nshow\nswitch costume to (platform v)\ngo to x: (-104) y: (-42)\nrepeat until <not <(SCENE #) = [204]>>\n    glide (2) secs to x: (174) y: (-42)\n    wait (1) seconds\n    glide (2) secs to x: (-104) y: (-42)\n    wait (1) seconds\nend\nhide\n\ngo to x: (-180) y: (-25)\n\nwait until <not <(SCENE #) = [104]>>\n\nadd [Key 1] to [collected v]\n\nwhen I receive [change scene v]\nswitch costume to (key 1 v)\ngo to [back v] layer\nhide\nif <(SCENE #) = [1]> then\n    set size to (100) %\n    Door at [231] [129] key [Key 1]\nend\nif <(SCENE #) = [106]> then\n    set size to (100) %\n    Door at [-100] [-63] key [Key 2]\nend\nif <(SCENE #) = [102]> then\n    set size to (100) %\n    Door at [131] [-21] key [Key 3]\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(new y) > (Last y)> then\n    change y by (1)\nelse\n    set y to ((Last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (Last x))\n    set [platform dy v] to ((new y) - (Last y))\nelse\n    go to x: (new x) y: (new y)\nend\n\nwhen flag clicked\nset size to (100) %\n\ngo to [front v] layer\n\nchange x by (4)\n\nchange x by (-4)\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\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 v]\nhide\n\n@SCORE\n\nwhen flag clicked\nsetup\n\nwhen I start as a clone\n\nshow\nforever\n    change costume to (join [Glow-] (letter (index) of (☁ TIMER)))\n    set x to (((((index) - (0.5)) - ((length of (☁ TIMER)) / (2))) * ((size) / (2))) - (200))\nend\n\nchange size by ((0.2) * ((100) - (size)))\n\ndefine setup\nhide\n\nswitch costume to (glow-9 v)\nset size to (50) %\ngo to x: (0) y: (140)\nset [index v] to [1]\nrepeat (6)\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 (50) %\nend\n\nset [lives v] to [200]\n\n@Lives\n\nwhen flag clicked\nshow\ngo to x: (0) y: (160)\nswitch costume to (3 heart v)\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [6]> then\n        switch costume to (6 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [7]> then\n        switch costume to (7 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [0]> then\n        switch costume to (0 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [8]> then\n        switch costume to (8 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [4]> then\n        switch costume to (4 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [3]> then\n        switch costume to (3 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [9]> then\n        switch costume to (9 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [5]> then\n        switch costume to (5 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [2]> then\n        switch costume to (2 heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [10]> then\n        switch costume to (10heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [11]> then\n        switch costume to (11heart v)\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <(LIVES) = [1]> then\n        switch costume to (1 heart v)\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\n\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [4 v]\n\nstart sound [pop v]\n\nwhen I receive [loadning v]\n\nshow\nswitch backdrop to (backdrop1 v)\nrepeat (30)\n    turn right (15) degrees\n    move (5) steps\n    create clone of (_myself_ v)\nend\nhide\nswitch backdrop to (pick random (1) to (10))\n\nrepeat (pick random (10) to (50))\nend\n\n@loadning\n\nwhen flag clicked\ngo to x: (0) y: (100)\nset size to (300) %\ngo to [front v] layer\nhide\n\nwhen I receive [1 v]\n\nwait (0.5) seconds\n\nwhen I receive [start v]\n\nwhen flag clicked\n\nwait (8) seconds\nbroadcast (Loadning v)\nswitch costume to (costume1 v)\nshow\nrepeat (3)\n    wait (0.3) seconds\n    next costume\nend\nhide\n\nbroadcast (Start NOW! v)\n\n@Background stuff\n\nwhen I start as a clone\nshow\ngo to [back v] layer\npoint in direction (pick random (-70) to (-100))\ngo to x: (300) y: (pick random (-180) to (180))\nset size to (pick random (10) to (15)) %\nset [ghost v] effect to (pick random (60) to (70))\ngo to [back v] layer\nrepeat until <<(x position) < [-220]> or <touching (sprite4 v)?>>\n    move (10) steps\nend\ndelete this clone\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    hide\n    create clone of (_myself_ v)\nend\n\nif <(y position) < [-18-]> then\n    delete this clone\nend\n\n@Detector\n\ndefine Touching love or fav button?\nswitch costume to (love v)\nif <touching (mouse-pointer v)?> then\n    if <<(mouse x) < [-88]> and <(mouse x) > [-240]>> then\n        switch costume to (fav v)\n        if <touching (mouse-pointer v)?> then\n            set [touching fav button? v] to [true]\n            set [touching love button? v] to [false]\n        else\n            set [touching fav button? v] to [false]\n            set [touching love button? v] to [true]\n        end\n    else\n        set [touching fav button? v] to [false]\n        set [touching love button? v] to [false]\n    end\nelse\n    set [touching fav button? v] to [false]\n    set [touching love button? v] to [false]\nend\n\nwhen I receive [start now! v]\nset size to (0) %\ngo to x: (0) y: (0)\nset size to (100) %\nforever\n    Touching love or fav button?\nend\n\nwhen I receive [start now! v]\nset [countdown love v] to [20]\nforever\n    if <(touching love button?) = [true]> then\n        change [countdown love v] by (-1)\n        if <(Countdown love) = [0]> then\n            broadcast (thx love v)\n            stop [this script v]\n        end\n    else\n        if <<(touching love button?) = [false]> and <(Countdown love) < [12]>> then\n            broadcast (thx love v)\n            stop [this script v]\n        end\n        set [countdown love v] to [20]\n    end\nend\n\nwhen I receive [start now! v]\nset [touching fav button? v] to [20]\nforever\n    if <(touching fav button?) = [true]> then\n        change [countdown fav v] by (-1)\n        if <(Countdown fav) = [0]> then\n            broadcast (thx fav v)\n            stop [this script v]\n        end\n    else\n        if <<(touching fav button?) = [false]> and <(Countdown fav) < [12]>> then\n            broadcast (thx fav v)\n            stop [this script v]\n        end\n        set [countdown fav v] to [20]\n    end\nend\n\n@Thanks\n\nwhen flag clicked\nswitch costume to (- v)\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nset size to (0) %\nrepeat until <(size) > [119]>\n    change size by (((120) - (size)) / (8))\n    change [ghost v] effect by (-25)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [thx fav v]\nif <(costume [name v]) = [-]> then\n    go to x: (0) y: (-150)\n    switch costume to (fav v)\n    create clone of (_myself_ v)\n    switch costume to (- v)\nend\n\nwhen I receive [thx love v]\nif <(costume [name v]) = [-]> then\n    go to x: (0) y: (-100)\n    switch costume to (love v)\n    create clone of (_myself_ v)\n    switch costume to (- v)\nend\n\n@Trampoline\n\nwhen flag clicked\nset [apples v] to [0]\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\nswitch costume to (scene1 v)\nswitch costume to (join [Scene] (SCENE #))\nif <(SCENE #) = [206]> then\n    if <([x position v] of [player v]) < [0]> then\n        show\n        go to x: (-70) y: (-47)\n    else\n        show\n        go to x: (70) y: (-47)\n        if <touching (player v)?> then\n            if <([speed y v] of [player v]) < [-3]> then\n                start sound [Jump v]\n                broadcast (trampoline v)\n                repeat (4)\n                    set costume trampoline\n                end\n            end\n        end\n    end\nelse\n    hide\nend\n\nhide\n\nset y to (0)\n\ndefine set costume trampoline\nnext costume\n\nwait (0.0001) seconds\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        if <([speed y v] of [player v]) < [-3]> then\n            start sound [Jump v]\n            broadcast (trampoline v)\n            repeat (4)\n                set costume trampoline\n            end\n        end\n    end\nend\n\n@sword\n\nwhen I receive [start now! v]\nset [sword? v] to [0]\nhide\nforever\n    if <(sword?) = [1]> then\n        go to (player v)\n        if <key (space v) pressed?> then\n            if <(weapon) = [sword]> then\n                start sound [High Whoosh v]\n                if <([direction v] of [player v]) = [90]> then\n                    go to (player v)\n                    show\n                    set [ghost v] effect to (0)\n                    point in direction (0)\n                    repeat (24)\n                        turn right (15) degrees\n                    end\n                    hide\n                else\n                    go to (player v)\n                    if <([direction v] of [player v]) = [-90]> then\n                        go to (player v)\n                        show\n                        set [ghost v] effect to (0)\n                        point in direction (0)\n                        repeat (24)\n                            turn left (15) degrees\n                        end\n                        hide\n                    end\n                end\n            end\n        end\n    end\nend\n\nchange [ghost v] effect by (2)\n\nchange [ghost v] effect by (2)\n\nturn right (15) degrees\n\nset [sword? v] to [1]\n\nwhen I receive [start now! v]\nforever\n    set size to (((APPLES) * (3)) + (100)) %\nend\n\nrepeat (2)\n    change [ghost v] effect by (50)\nend\n\nrepeat (2)\n    change [ghost v] effect by (50)\nend\n\nwhen I receive [start now! v]\nforever\n    go to (player v)\nend\n\nset [lives v] to [11111]\n\nstart sound [High Whoosh v]\n\n@Platforms\n\ndefine Animate platform\nset size to (100) %\nshow\nswitch costume to (costume1 v)\ngo to x: (140) y: (-100)\nforever\n    glide (1.5) secs to x: (88) y: (46)\n    wait (1) seconds\n    glide (1.5) secs to x: (140) y: (-100)\n    wait (1) seconds\nend\n\ndefine Animate platform1\nset size to (100) %\nshow\nswitch costume to (costume1 v)\npoint in direction (90)\ngo to x: (92) y: (-90)\nforever\n    glide (2) secs to x: (-173) y: (-90)\n    wait (2) seconds\n    glide (2) secs to x: (92) y: (-90)\n    wait (2) seconds\nend\n\ndefine Animate platform 2\nset size to (100) %\nshow\nswitch costume to (costume1 v)\npoint in direction (90)\ngo to x: (111) y: (0)\nforever\n    glide (1.5) secs to x: (-138) y: (0)\n    wait (0.3) seconds\n    glide (1.5) secs to x: (111) y: (0)\n    wait (0.3) seconds\nend\n\ndefine Animate platform3\n\nwhen I start as a clone\nshow\nglide (1.3) secs to x: (-180) y: (140)\ndelete this clone\n\ndefine animate platform 4\n\nset [lives v] to [4]\n\nwhen I receive [change scene v]\nhide\nif <(SCENE #) = [6]> then\n    show\n    Animate platform\nend\nif <(SCENE #) = [102]> then\n    show\n    Animate platform1\nend\nif <(SCENE #) = [103]> then\n    show\n    Animate platform 2\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(new y) > (Last y)> then\n    change y by (1)\nelse\n    set y to ((Last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (Last x))\n    set [platform dy v] to ((new y) - (Last y))\nend\ngo to x: (new x) y: (new y)\n\nwhen flag clicked\nset size to (100) %\n\ngo to [front v] layer\n\nset [lives v] to [8]\n\ndefine animate platform 5\n\nwait (1) seconds\nwait (1) seconds\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (135) y: (144)\nhide\n\nset [lives v] to [99]\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\ngo to [back v] layer\nset size to (100) %\n\nwhen I receive [change scene v]\nif <(SCENE #) = [105]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [210] [-120] dir [-90]\n        Spawn [Red] at [190] [-120] dir [-90]\n        Spawn [Red] at [170] [-120] dir [-90]\n    else\n        Spawn [Red] at [-195] [-120] dir [-90]\n        Spawn [Red] at [-175] [-120] dir [-90]\n        Spawn [Red] at [-155] [-120] dir [-90]\n    end\nend\n\nSpawn [Red] at [-65] [40] dir [-90]\n\nwhen I start as a clone\nset [ghost v] effect to (0)\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 or 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\n    if <<touching (sword v)?> or <touching (sprite7 v)?>> then\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        hide\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)?>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\ncreate clone of (_myself_ v)\n\ndefine Move - Left or Right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (safe zones v)?> or <touching (doors v)?>>> then\n            stop [this script v]\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 squish v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (25)\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 receive [start now! v]\nforever\n\nSpawn [Red] at [45] [-70] dir [-90]\nSpawn [Red] at [-60] [-70] dir [90]\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\nswitch costume to (blank v)\n\nswitch costume to (join [Scene] (SCENE #))\n\nset y to (0)\n\nset [ghost v] effect to (0)\n\nwhen I receive [start now! v]\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n@Sprite7\n\nwhen flag clicked\n\nwhen I start as a clone\npoint in direction (90)\ngo to (player v)\nclear graphic effects\nshow\nif <([direction v] of [player v]) = [90]> then\n    change x by (10)\n    repeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n        turn right (20) degrees\n        change x by (8)\n    end\n    change x by (10)\nelse\n    change x by (-10)\n    repeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n        turn right (-20) degrees\n        change x by (-8)\n    end\n    change x by (-10)\nend\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    if <not <touching (level v)?>> then\n        change y by (-4)\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [level change v]\ndelete this clone\n\nif <[] > [0]> then\nend\n\nwhen I receive [start now! v]\nset [weapon v] to [sword]\nset [ninja star? v] to [0]\nforever\n    if <key (space v) pressed?> then\n        if <(ninja star?) = [1]> then\n            if <(weapon) = [ninja star]> then\n                create clone of (_myself_ v)\n                change [ninja stars v] by (-1)\n                wait until <not <key (space v) pressed?>>\n            end\n        end\n    end\nend\n\nwhen [s v] key pressed\n\nwhen I receive [start now! v]\nforever\n    if <key (s v) pressed?> then\n        if <(weapon) = [ninja star]> then\n            set [weapon v] to [sword]\n            wait until <not <key (s v) pressed?>>\n        else\n            set [weapon v] to [ninja star]\n            wait until <not <key (s v) pressed?>>\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\n\nwhen [s v] key pressed\n\nnext costume\n\n\n    next costume\nend\n\nwait until <not <key (s v) pressed?>>\n\n\nend\n\nwhen flag clicked\n\nwhen I receive [start now! v]\ngo to x: (-124) y: (151)\nhide\nforever\n    if <not <<(ninja star?) = [1]> or <(sword?) = [1]>>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <<(ninja star?) = [1]> and <(weapon) = [ninja star]>> then\n        switch costume to (ninja star v)\n    end\n    if <<(sword?) = [1]> and <(weapon) = [sword]>> then\n        switch costume to (sword v)\n    end\nend\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]\nset [ghost v] effect to (100)\nswitch costume to (blank v)\n\nswitch costume to (join [Scene] (SCENE #))\n\nset y to (0)\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]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nhide\ngo to x: (0) y: (0)\nif <(SCENE #) = [1]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [2]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [202]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [102]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [101]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [206]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\n\nset y to (0)\n\nforever\n    set y to ((5) * ([sin v] of ((timer) * (360)) ))\nend\n\nset y to ((5) * ([sin v] of ((timer) * (360)) ))\n\nforever\n    show\nend\n\nif <(SCENE #) = [2]> then\n    go to [back v] layer\n    switch costume to (scene205 v)\n    show\n    go to x: (0) y: (0)\nend\n\ngo to [back v] layer\nswitch costume to (scene1 v)\n\ngo to x: (0) y: (0)\n\n@Griffpatch?\n\nwhen I receive [start now! v]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\nforever\n    if <(username) = [Griffpatch]> then\n        change [☁ griffpatch v] by (1)\n        broadcast (Griffpatch v)\n        wait until <not <(username) = [Griffpatch]>>\n    end\nend\n\nwhen I receive [griffpatch v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nshow\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\n\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nset [brightness v] effect to (0)\ngo to [front v] layer\nshow\ngo to x: (0) y: (-120)\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (40)\n        change size by ((0.2) * ((130) - (size)))\n        point in direction ((([sin v] of ((timer) * (250)) ) * (10)) + (90))\n    else\n        change size by ((0.2) * ((100) - (size)))\n        point in direction (((direction) - ((direction) / (10))) + (9))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nbroadcast (Start v)\nbroadcast (Start NOW! v)\nbroadcast (Reset Game v)\nhide\n\nwait (5) seconds\n\n@Control stick\n\nwhen flag clicked\ngo to [front v] layer\nset [myself v] to [Control stick]\nset size to (100) %\nset [max stick v] to ((size) / (4))\nswitch costume to (base v)\nset [ghost v] effect to (60)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (25)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen flag clicked\nset [stick power v] to [0]\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\n
Read all instructions before playing! ⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️\nPart 2 is out!\nPart 1: \nhttps://scratch.mit.edu/projects/628988104\nPart 3:\nhttps://scratch.mit.edu/projects/670498597\nMobile friendly!\nControls:\nW,A,S,D or arrow keys to move.\nSpace to throw sword and to throw ninja stars\n"S" to change weapon\nyour swords size depends on how many coins you have collected.      Please love, fav. and follow for more, this is a AMAZING platform game, with vertical levels, springs, wall jump and moving spikes, ninja stars, lava and platforms, collect coins, collect lives, enemis, animated platform, checkpoints and a very special key to unlock the door. \nCan you beat the highscore???\nWrite in the comments if you have any suggestions.\nI will do the next part when I reach 20 loves.\nThank you so much for 1000 views, 100 loves and 100 fav!\n\nChangelog:\nJan 22 2022,Added springs\nJan 23 2022, Fixed bug with the collectables\nJan 29 2022, Made the platforms slower\nFeb 1 2022, Added a sword\nFeb 1 2022, Added ninja stars\nFeb 4 2022, Changed the levels\nFeb 13 2022, made it mobile friendly