☃Cat platformer Part 1❄
@Stage\n\n@Danger\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join [Scene] (Scene #))\n\nforever\n    show\n    set y to ((12.5) * ([sin v] of ((timer) * (360)) ))\nend\n\n@Plaform\n\nwhen I receive [change scene v]\nhide\ngo to [back v] layer\nif <(Scene #) = [1]> then\n    Door at: [61] [122] Key [Key 3]\nend\nif <(Scene #) = [3]> then\n    Animate Platforms | Start x, y [81] [-38] End x, y [14] [35] Start Glide for secs: [2] End Glide for secs: [2] Wait: [1]\nend\nif <(Scene #) = [101]> then\n    Door at: [185] [77] Key [Key 2]\nend\nif <(Scene #) = [103]> then\n    Door at: [-165] [39] Key [Key 1]\nend\n\ndefine Animate Platform 1\ngo to x: (81) y: (-38)\nforever\n    glide (2) secs to x: (14) y: (35)\n    wait (1) seconds\n    glide (2) secs to x: (81) y: (-38)\n    wait (1) seconds\nend\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(new y) > (last y)> then\n    change y by (1)\nelse\n    set y to ((last y) + (1))\nend\nif <touching (player \(scratch pack\) v)?> then\n    set [platform dx v] to ((new x) - (last x))\n    set [platform dy v] to ((new y) - (last y))\nend\ngo to x: (new x) y: (new y)\n\ndefine 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 \(scratch pack\) v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player \(scratch pack\) v)?>>\nend\n\ndefine Animate Platforms | Start x, y (x) (y) End x, y (x) (y) Start Glide for secs: (secs1) End Glide for secs: (secs2) Wait: (secs3)\nshow\ngo to x: (x) y: (y)\nswitch costume to (platform v)\nforever\n    glide (secs1) secs to x: (81) y: (-38)\n    wait (secs3) seconds\n    glide (secs2) secs to x: (x) y: (y)\n    wait (secs3) 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 \(scratch pack\) 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    start sound [Chomp v]\n    change [apples v] by (1)\nelse\n    start sound [Wand v]\n    add (costume [name v]) to [collected 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 [frame v] to [0]\nset [apples v] to [0]\nhide\nPlace [Apple] Scene [1] x, y [120] [-10]\nPlace [Apple] Scene [1] x, y [-27] [43]\nPlace [Apple] Scene [2] x, y [16] [-25]\nPlace [Apple] Scene [103] x, y [-32] [43]\nPlace [big Apple] Scene [101] x, y [85] [71]\nPlace [Key 1] Scene [103] x, y [-124] [-133]\nPlace [Key 2] Scene [102] x, y [85] [71]\nPlace [Key 3] Scene [101] x, y [187] [-112]\n\ndefine Place (costume name) Scene (scene) x, y (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 start as a clone\n\nwhen I receive [reset game v]\ndelete this clone\n\n@Checkpoints\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 \(scratch pack\) v)?>\n    next costume\n    wait (0.1) seconds\nend\nset [my scene v] to []\nstart sound [Collect v]\nset [spawn scene v] to (Scene #)\nset [spawn x v] to ([x position v] of [player \(scratch pack\) v])\nset [spawn y v] to ([y position v] of [player \(scratch pack\) v])\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 [apples v] to [0]\nhide\nPlace [Green Flag] Scene [2] x, y [128] [-53]\nPlace [Green Flag] Scene [1] x, y [98] [82]\n\ndefine Place (costume name) Scene (scene) x, y (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 start as a clone\n\nwhen I receive [reset game v]\ndelete this clone\n\nwhen I receive [start game v]\nforever\n\nwhen I start as a clone\nforever\n    if <<touching (player \(scratch pack\) v)?> and <(Scene #) = [1]>> then\n        broadcast (XMAS TIME! v)\n    end\nend\n\n@Miniature\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 (Menu v)\n\nwhen I receive [start game v]\nhide\n\n@Main Menu\n\nwhen I receive [menu v]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (0) y: (-82)\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\nbroadcast (Start Game v)\n\n@Snow\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (0.000000001) seconds\nend\n\nwhen I start as a clone\ngo to x: (pick random (-400) to (400)) y: (449)\nglide (2) secs to x: (pick random (-236) to (236)) y: (-175)\ndelete this clone\n\n@Music\n\nwhen flag clicked\nforever\n    play sound [Jingle Bells Violin \(loop\) - pixabay v] until done\nend\n\n@Apple Counter\n\nwhen I start as a clone\nshow\nforever\n    Change Costume to: (join [Glow-] (letter (index) of (Apples)))\n    change size by ((0.2) * ((50) - (size)))\nend\n\ndefine Setup\nhide\nset size to (50) %\ngo to [front v] layer\ngo to x: (-143) y: (-89)\nset [index v] to [1]\nrepeat (3)\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 (70) %\nend\n\nwhen I receive [start game v]\nSetup\n\nset x to ((((index) - (0.5)) - ((length of (Apples)) / (2))) * ((size) / (2)))\n\n@Show Screen\n\nwhen I receive [setup v]\nshow\ngo to [front v] layer\ngo [forward v] (1) layers\n\n@LIVES Counter\n\nwhen I start as a clone\nshow\nforever\n    Change Costume to: (join [Glow-] (letter (index) of (LIVES)))\n    change size by ((0.2) * ((50) - (size)))\nend\n\ndefine Setup\nhide\nset size to (50) %\ngo to [front v] layer\ngo to x: (-143) y: (-147)\nset [index v] to [1]\nrepeat (1)\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 (70) %\nend\n\nwhen I receive [start game v]\nSetup\n\nset x to ((((index) - (0.5)) - ((length of (Apples)) / (2))) * ((size) / (2)))\n\n@Player (Scratch Pack)\n\nwhen flag clicked\nbroadcast (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 Soild\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 Soild\n    if <(touching) > [0]> then\n        Collide Y - Ceiling or Floor\n    end\nend\n\ndefine Check Touching Soild\nif <<touching (level v)?> or <touching (plaform 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\nControls - Up and Down\nControls - Left and Right\nMove - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nSet Costume\n\ndefine Controls - Up and Down\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> 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 <<mouse down?> and <(mouse x) > (x position)>>> - <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>)\nif <(KEY X) = [0]> then\n    if <<(Falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((KEY X) * (Acceleration))\n    point in direction ((KEY X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (Resistance))\n\ndefine Reset and Begin Level\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\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 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 (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collision in Direction [0]\nelse\n    Fix Collision in Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collision in Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Soild\n    if <(touching) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick - first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Soild\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 Soild\nif <(touching) > [0]> then\n    change y by (1)\n    Check Touching Soild\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 Soild\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 Soild\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 Soild\nset [wall slide v] to (touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [lose life v]\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 Soild\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 Soild\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\nFix Collision in Direction [0]\n\nwhen I receive [start game v]\nset [gravity v] to [-1.5]\nset [jump force v] to [13]\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 [3]\nset [spawn scene v] to [1]\nset [spawn x v] to [-141]\nset [spawn y v] to [44]\nReset and Begin Level\n\n@Music2\n\nwhen flag clicked\nforever\n    play sound [Jingle Bells Violin \(loop\) - pixabay v] until done\nend\n\n@Xmas\n\nwhen I receive [xmas time! v]\nshow\nforever\n    point in direction ((([sin v] of ((Animate) + (-50)) ) * (5)) + (90))\n    set size to ((([sin v] of (Animate) ) * (-5)) + (105)) %\n    change [animate v] by (8)\nend\n\nwhen flag clicked\nhide\nset [animate v] to [1]\n\n@(Love Fave Follow)\n\nwhen I receive [green flag clicked v]\nbroadcast (love fave follow v)\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go [forward v] (25) layers\n    show\n    go to x: (-104) y: (-200)\n    wait (1) seconds\n    glide (1) secs to x: (-51) y: (-125)\n    wait (0.3) seconds\n    go to [front v] layer\n    glide (0.5) secs to x: (-20) y: (-125)\n    wait (0.3) seconds\n    glide (1) secs to x: (35) y: (-125)\n    wait (2) seconds\n    hide\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    go [forward v] (25) layers\n    show\n    go to x: (0) y: (-123)\n    set size to (0) %\n    repeat until <(size) > [100]>\n        change size by (((50) + (size)) / (25))\n    end\n    wait (2.5) seconds\n    hide\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go [forward v] (25) layers\n    hide\n    wait (2.5) seconds\n    show\n    go to x: (0) y: (-123)\n    wait (4.1) seconds\n    hide\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [4]> then\n    go [forward v] (25) layers\n    hide\n    wait (3.3) seconds\n    show\n    go to x: (0) y: (-123)\n    wait (3.3) seconds\n    hide\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [5]> then\n    go [forward v] (25) layers\n    hide\n    wait (4.6) seconds\n    show\n    go to x: (0) y: (-123)\n    wait (2) seconds\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [love fave follow v]\nwait (1) seconds\nswitch costume to (love fave follow!!! v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (love fave follow!!!2 v)\ncreate clone of (_myself_ v)\nswitch costume to (love fave follow!!!3 v)\ncreate clone of (_myself_ v)\nswitch costume to (love fave follow!!!4 v)\ncreate clone of (_myself_ v)\nswitch costume to (love fave follow!!!6 v)\ncreate clone of (_myself_ v)\nhide\n\nwhen flag clicked\nforever\n    broadcast (green flag clicked v)\n    wait (45) seconds\nend\n\n@Level\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen I receive [change scene v]\nerase all\nswitch costume to (join [Scene] (Scene #))\nStamp Outline\nStamp Shadow\n\n
░I░n░s░t░r░u░c░t░i░o░n░s░:░\n░♦░️░ ░⬅░ ░⬆░ ░➡░ mobile░♦░️░\n\n(っ◔◡◔)っ ❄ㅤㅤㅤㅤ♦️ ❄ Sαℓυт admire єт ¢σηтємρℓє נυѕтє  мα ¢яéαтιση ☃\n                                                                    вση נєυ ! ♦️\n\nᴬ ²⁰⁰ ❤ ᵉᵗ ¹⁰⁰ ⭐ ⁼ ᵖᵃʳᵗ ² 