Scratch Blocks/// A Platformer

Instructions: ⭐⭐How To Play⭐⭐\n➡️Use Arrow Keys Or WASD To Move\n➡️Use The Joystick If You Are Mobile\n➡️5 Lives\n➡️Comment "Finished" If You Finished\n➡️Tell Me About Glitches\n➡️❤️ & ⭐

@Stage\n\nwhen I receive [main menu v]\nset volume to (100) %\nwait (0.5) seconds\nforever\n    play sound [Cipher - Electronic Light - Kevin MacLeod v] until done\nend\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\n\nwhen [timer v] > (Timer)\nerase all\nswitch backdrop to (backdrop1 v)\nbroadcast (Outro v)\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nset [scene# v] to [1]\nrepeat until <(Outro) = [1]>\n    set [timer v] to (timer)\nend\n\n@Empty\n\nset [intro v] to [0]\n\n@Player\n\nwhen flag clicked\nhide\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 - Ceiling or Floor \n    end\nend\n\ndefine Check Touching Solid \nif <<touching (level v)?> or <touching (platform 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-X) ) + ([abs v] of (Speed-Y) ))\nShow Health (Health) Of (Max Health) Offset Y [40]\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        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        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.98))\n        stop [this script v]\n    end\n    if <([abs v] of (Speed-X) ) < [1]> then\n        set [frame v] to [0]\n        set [speed-x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed-x v] by ((Key X) * (Acceleration))\n    if <not <(direction) = ((Key X) * (90))>> then\n        set [wall slide v] to [0]\n    end\n    point in direction ((Key X) * (90))\n    change [frame v] by (1)\nend\nset [speed-x v] to ((Speed-X) * (Resistance))\n\ndefine Reset and Begin Level\nset [invulnerable v] to [0]\nset [speed-x v] to [0]\nset [speed-y v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\npoint in direction (90)\nBegin Scene # (Spawn Scene) Go to X, Y: (Spawn X) (Spawn Y)\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Platforms v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - Last v)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    Begin Scene # ((Scene#) + (1)) Go to X, Y: [-235] []\nend\nif <(x position) < [-235]> then\n    Begin Scene # ((Scene#) + (-1)) Go to X, Y: [235] []\nend\nif <touching (danger v)?> then\n    broadcast (Lose Life v)\nend\nif <(y position) < [-180]> 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 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 Solid \n    if <(Touching) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (Distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick - first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(Wall Slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(Speed-Y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(Frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((Frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Solid \n        if <(Touching) < [1]> then\n            switch costume to ((costume [number v]) + (5))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\ndefine Collide X - Slope or Wall?\nCheck Can Wall Slide\nchange y by (1)\nCheck Touching Solid \nif <(Touching) > [0]> then\n    change y by (1)\n    Check Touching Solid \n    if <(Touching) > [0]> then\n        change y by (-2)\n        set x to (Last Value)\n        set [speed-x v] to [0]\n        stop [this script v]\n    end\n    set [speed-x v] to ((Speed-X) * (0.8))\nend\nset [speed-x v] to ((Speed-X) * (0.95))\nSlip\n\ndefine Collide Y - Ceiling or Floor \nset y to (Last Value)\nif <(Speed-Y) > [0]> then\n    set [speed-y v] to [0]\n    stop [this script v]\nend\nif <(Falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed-y v] to ((Speed-Y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck Touching Solid \nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed-x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching Solid \nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed-x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Check Can Wall Slide\nif <(Falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\nCheck Touching Solid \nset [wall slide v] to (Touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [lose life v]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [health v] by (-1)\nif <(Health) > [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\nwhen I receive [start game v]\ngo to [front v] layer\nshow\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\nbroadcast (Reset Game v) and wait\nbroadcast (Setup v) and wait\nset [max health v] to [5]\nset [health v] to (Max Health)\nset [spawn scene v] to [1]\nset [spawn x v] to [-125]\nset [spawn y v] to [55]\nReset and Begin Level\n\nwhen I receive [player - bounce v]\nset [speed-y v] to [10]\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\nhide\n\ndefine Show Health (health) Of (max) Offset Y (y)\nadd (x position) to [healths v]\nadd ((y position) + (y)) to [healths v]\nadd ((health) / (max)) to [healths v]\ncreate clone of (health bar v)\n\n@Level\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen flag clicked\nerase all\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (Scene#))\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\nwhen I receive [about to change scene v]\nerase all\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nset [scene# v] to [1]\nset [outro v] to [0]\nforever\n    if <(Scene#) = [15]> then\n        wait (5) seconds\n        set [outro v] to [1]\n    end\nend\n\n@Danger\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen flag clicked\nerase all\nhide\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (Scene#))\nStamp Outline\nStamp Shadow\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [about to change scene v]\nerase all\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [outro v]\nhide\n\n@Main Menu\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n        set [brightness v] effect to (5)\n    else\n        change size by ((0.2) * ((100) - (size)))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nstart sound [Click v]\nbroadcast (Start Game v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [main menu v]\nset [ghost v] effect to (100)\nif <(Intro) < [1]> then\n    wait (1) seconds\nend\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        start sound [button v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [outro v]\nhide\n\nwhen I receive [game over v]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n        set [brightness v] effect to (5)\n    else\n        change size by ((0.2) * ((100) - (size)))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [game over v]\nset [ghost v] effect to (100)\nif <(Intro) < [1]> then\n    wait (1) seconds\nend\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        start sound [button v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\n@Splash Screen\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nif <(Intro) < [1]> then\n    wait (1) seconds\nend\nhide\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen I receive [start game v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [outro v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n@PFP\n\nwhen I receive [main menu v]\n\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nhide\ngo to [back v] layer\nclear graphic effects\nset [ghost v] effect to (90)\nshow\n\nwhen flag clicked\nhide\n\nset [ghost v] effect to (100)\n\nwhen I receive [outro v]\n\nstop [other scripts in sprite v]\nhide\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\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 []\nset volume to (20) %\nstart sound [Key v]\nset [spawn scene v] to (Scene#)\nset [spawn x v] to ([x position v] of [player v])\nset [spawn y v] to ([y position v] of [player 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 [frame v] to [0]\nset [green flag v] to [Green Flag]\nhide\nPlace (Green Flag) Scene [3] XY [36] [118]\nPlace (Green Flag) Scene [4] XY [207] [-93]\nPlace (Green Flag) Scene [6] XY [115] [48]\nPlace (Green Flag) Scene [9] XY [69] [-110]\nPlace (Green Flag) Scene [12] XY [53] [-52]\n\ndefine Place (costume name) Scene (scene) XY (x) (y)\nset [my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nwhen I receive [reset game v]\ndelete this clone\n\n@Bouncing icon By @TimMcCool\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nforever\n    wait until <touching (mouse-pointer v)?>\n    repeat (10)\n        change [brightness v] effect by (5)\n    end\n    wait until <not <touching (mouse-pointer v)?>>\n    repeat (10)\n        change [brightness v] effect by (-5)\n    end\n    clear graphic effects\nend\n\nwhen I receive [main menu v]\nforever\n    repeat until <touching (mouse-pointer v)?>\n        change size by (((size) - (100)) / (-4))\n    end\n    wait until <not <touching (mouse-pointer v)?>>\n    start sound [Boing v]\n    set size to (100) %\n    set [__stop_effect_size_vel v] to [20]\n    repeat (17)\n        change [__stop_effect_size_vel v] by (-2.5)\n        change size by (__stop_effect_size_vel)\n    end\nend\n\nwhen I receive [main menu v]\ngo to x: (203) y: (-144)\nchange y by (-100)\nwait (0.15) seconds\nshow\nset size to (100) %\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    change [ghost v] effect by (-10)\n    set [b v] to (((b) * (0.6)) + (((y position) - (-144)) * (-0.2)))\n    change y by (b)\nend\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\nhide\n\n@Like and Fav\n\nwhen I receive [start game v]\ngo to x: (0) y: (224)\nforever\n    wait (pick random (30) to (40)) seconds\n    repeat until <(y position) < [6]>\n        change y by (((-5) - (y position)) / (6))\n    end\n    wait (3) seconds\n    repeat until <(y position) > [50]>\n        change y by (((5) + (y position)) / (6))\n    end\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (224)\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\nhide\n\n@OC\n\nwhen flag clicked\nhide\n\n@Outro\n\ndefine BIG Smooth Glide (x) (y) spd: (speed) dir (dir) siz (siz)\nrepeat until <<(round (x position)) = (round (x))> and <<(round (y position)) = (round (y))> and <<(round (size)) = (siz)> and <(round (direction)) = (dir)>>>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\n    turn right (((round (dir)) - (round (direction))) / (speed)) degrees\n    change siz (((round (siz)) - (round (size))) / (speed))\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [OC]> then\n    switch costume to (oc v)\n    go to x: (0) y: (0)\n    show\n    set size to (100) %\n    forever\n        point in direction ((([cos v] of ((timer) * (180)) ) * (4)) + ((([cos v] of ((timer) * (180)) ) * (4)) + (90)))\n    end\nend\n\ndefine Outro\nforever\n    switch costume to (pick random (5) to (7))\n    repeat (10)\n        create clone of (_myself_ v)\n    end\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Username]> then\n    set size to (100) %\n    go to x: (0) y: (-123)\n    point in direction (90)\n    go to [front v] layer\n    show\n    switch costume to (username v)\n    BIG Smooth Glide [0] [-123] spd: [8] dir [90] siz [100]\n    forever\n        set x to ((0) + (([sin v] of ((200) * (timer)) ) * (15)))\n        set size to ((100) + (([cos v] of ((200) * (timer)) ) * (15))) %\n    end\nend\n\nwhen I start as a clone\nif <<<<(costume [name v]) = [Love]> or <(costume [name v]) = [Fav]>> or <(costume [name v]) = [Follow]>> or <(costume [name v]) = [Remix]>> then\n    forever\n        go to x: (0) y: (0)\n        clear graphic effects\n        switch costume to (pick random (4) to (7))\n        show\n        go to [back v] layer\n        go [forward v] (1) layers\n        set size to (pick random (30) to (40)) %\n        set y to (180)\n        point in direction (90)\n        set [brightness v] effect to (pick random (0) to (20))\n        set x to (pick random (-200) to (200))\n        wait (.03) seconds\n        repeat (18)\n            change [ghost v] effect by (4)\n            change y by (-20)\n        end\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [BG]> then\n    go to x: (0) y: (0)\n    show\n    go to [back v] layer\nend\n\nwhen I receive [outro v]\nset [ghost v] effect to (100)\nhide\npoint in direction (90)\nswitch costume to (oc v)\ncreate clone of (_myself_ v)\nswitch costume to (username v)\ncreate clone of (_myself_ v)\nswitch costume to (love v)\ncreate clone of (_myself_ v)\nswitch costume to (fav v)\ncreate clone of (_myself_ v)\nswitch costume to (follow v)\ncreate clone of (_myself_ v)\nswitch costume to (remix v)\ncreate clone of (_myself_ v)\nswitch costume to (bg v)\ncreate clone of (_myself_ v)\nOutro\n\nwhen I receive [outro v]\nset volume to (50) %\nforever\n    play sound [Hinkik - Time Leaper v] until done\nend\n\n@Control Stick\n\nwhen flag clicked\ngo to x: (190) y: (-130)\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)\nhide\ncreate clone of (_myself_ v)\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo to [front v] layer\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\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\nwhen I receive [start game v]\nshow\n\nwhen I receive [outro v]\nstop [other scripts in sprite v]\nhide\n\n@Game Over :(\n\nwhen flag clicked\nhide\n\nwhen I receive [game over v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen I receive [start game v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\n@Health Bar\n\nwhen flag clicked\nhide\ndelete all of [healths v]\n\nwhen I start as a clone\nset x to (item (1) of [healths v])\nset y to (item (2) of [healths v])\nswitch costume to ((10) * (item (3) of [healths v]))\ndelete (1) of [healths v]\ndelete (1) of [healths v]\ndelete (1) of [healths v]\nif <not <touching (_edge_ v)?>> then\n    go to [front v] layer\n    show\n    wait (0) seconds\nend\ndelete this clone\n\ndefine Show Health (health) Of (max) Offset Y (y)\nadd (x position) to [healths v]\nadd ((y position) + (y)) to [healths v]\nadd ((health) / (max)) to [healths v]\ncreate clone of (health bar v)\n\n@Intro\n\nwhen flag clicked\nbroadcast (Intro v)\n\nset [intro played? v] to [false]\n\nwhen I receive [intro v]\nif <(Intro played?) = [false]> then\n    go to x: (0) y: (0)\n    point in direction (90)\n    set size to (100) %\n    hide\n    start sound [Super Mario Run \(Trap Remix\) v]\n    Clone all PFP part\n    Clone [0] [0] [Background]\n    Clone [0] [0] [Original PFP]\n    Clone [0] [0] [Beat]\nelse\n    broadcast (Main Menu v)\nend\n\ndefine Clone (x) (y) (costume)\nswitch costume to (costume)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\ndefine Clone all PFP part\nClone [0] [0] [PFP Part 1]\nClone [0] [206] [PFP Part 2]\nClone [0] [-206] [PFP Part 3]\nClone [-202] [0] [PFP Part 4]\nClone [202] [0] [PFP Part 5]\n\nwhen I start as a clone\nif <(costume [name v]) = [PFP Part 1]> then\n    set size to (0) %\n    show\n    repeat until <(size) > [99.5]>\n        change size by (((100) - (size)) / (10))\n    end\n    set size to (100) %\n    wait (0.8) seconds\nend\nif <(costume [name v]) = [PFP Part 2]> then\n    show\n    repeat until <(y position) < [0.5]>\n        change y by (((0) - (y position)) / (10))\n    end\n    set y to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 3]> then\n    show\n    repeat until <(y position) > [-0.5]>\n        change y by (((0) - (y position)) / (10))\n    end\n    set y to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 4]> then\n    show\n    repeat until <(x position) > [-0.5]>\n        change x by (((0) - (x position)) / (10))\n    end\n    set x to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 5]> then\n    show\n    repeat until <(x position) < [0.5]>\n        change x by (((0) - (x position)) / (10))\n    end\n    set x to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [Background]> then\n    set [intro: x vel v] to [-1]\n    set [intro: y vel v] to [-1]\n    wait (2.4) seconds\n    show\n    repeat (135)\n        go to x: (0) y: (0)\n    end\n    set [intro played? v] to [true]\n    broadcast (Main Menu v)\n    repeat until <(y position) < [-347]>\n        change y by (Intro: y vel)\n        change [intro: y vel v] by ((Intro: y vel) / (4))\n        change x by (Intro: x vel)\n        change [intro: x vel v] by ((Intro: x vel) / (4))\n        go to [front v] layer\n        go [backward v] (1) layers\n    end\nend\nif <(costume [name v]) = [Original PFP]> then\n    set [intro: var v] to [0]\n    wait (2.4) seconds\n    show\n    wait (0.5) seconds\n    repeat (110)\n        PFP action\n    end\n    repeat until <(size) < [50.5]>\n        change size by (((50) - (size)) / (5))\n        change [ghost v] effect by (5)\n        go to [front v] layer\n        PFP action\n    end\nend\nif <(costume [name v]) = [Beat]> then\n    set size to (0) %\n    wait (2.35) seconds\n    show\n    repeat until <(size) > [199.9]>\n        change size by (((200) - (size)) / (5))\n        change [ghost v] effect by (5)\n    end\nend\ndelete this clone\n\ndefine PFP action\nchange [intro: var v] by (10)\npoint in direction ((([sin v] of (Intro: var) ) * (10)) + (90))\nset y to (([sin v] of ((Intro: var) * (2)) ) * (10))\n\n