Platformer - Scratch Cat in Dimensions

Instructions: Please read instructions and credits!\n\nArrow keys or WASD (space is an alternate jump) to move.\n\nWall jumping: run and jump into a wall, and then jump and then you will go up that wall. In other words, jump into a wall and press the up arrow key again. \n\nAvoid: Spikes, lava, and platforms trying to crush you.\n\nGet keys to unlock doors. \n\nHearts give you extra lives. You don't have to get them. \n\nMusic button: Click on it to turn on the song and then click it to turn it off.\n\nRestart Button: Click on it, then click on "play" then it restarts the game for you.\n\nWorlds: \nPurple: Easy \nGreen: Medium\nOrange: Cat World\nSo far, there are only 3 dimensions. \nIt's not easy to hard.\nI was thinking of black: IMPOSSIBLE\n\nNew levels constantly added!\n\nDo you have any ideas?\n\nPS. Can you find the 14 apples??\n\nAdvertising? No, please don't, but if you followed me, then go ahead!\n\nSpamming? Yeah, sure, but don't do it too much!

@Stage\n\n@Player\n\nwhen flag clicked\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 ((Player: 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 ((Player: 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 (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 (Player: speed x) ) + ([abs v] of (Player: speed y) ))\nSet Costume\n\ndefine Controls - Up and Down\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> then\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n        start sound [Jump v]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [player: 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 [player: speed y v] to (JUMP FORCE)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [player: speed y v] by (GRAVITY)\nif <(wall slide) > [0]> then\n    Check Can Wall Side\n    if <(Player: speed y) < [0]> then\n        set [player: speed y v] to ((Player: 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 (d v) pressed?> or <key (right arrow v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nif <(KEY X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [player: speed x v] to ((Player: speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (Player: speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [player: speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [player: 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 [player: speed x v] to ((Player: speed x) * (RESISTANCE))\n\ndefine Reset and Begin Level\nset [invulnerable v] to [0]\nset [player: speed x v] to [0]\nset [player: 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 (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 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 [player: 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 (Player: 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 [0]\nset [platform dy v] to [0]\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 <(Player: 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 Side\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 [player: speed x v] to [0]\n        stop [this script v]\n    end\n    set [player: speed x v] to ((Player: speed x) * (0.8))\nend\nset [player: speed x v] to ((Player: speed x) * (0.95))\nSlip\n\ndefine Collide Y - Ceiling or Floor\nset y to (last value)\nif <(Player: speed y) > [0]> then\n    set [player: 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 [player: speed y v] to ((Player: 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 [player: 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 [player: speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Check Can Wall Side\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]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(Lives) > [0]> then\n    Reset and Begin Level\nelse\n    broadcast (Game Over v)\nend\n\ndefine Moved - by Moving Platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nCheck Touching 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 [player: 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 (Player: 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 (Player: temp)\n\nwhen I receive [start game v]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\nbroadcast (Reset Game v) and wait\nbroadcast (Setup v) and wait\nset [lives v] to [3]\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 [player: speed y v] to [10]\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\nStamp Shadow\nStamp Outline\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 (89)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\n@Danger\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <(SCENE #) = [21]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [19]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\n@Platform \n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [4]> then\n    Spawn [Key 1] at [-138] [-30] dir [90]\nend\nif <(SCENE #) = [206]> then\n    Spawn [Key 2] at [-134] [14] dir [90]\nend\nif <(SCENE #) = [128]> then\n    Spawn [Key 3] at [-128] [-76] dir [90]\nend\nif <(SCENE #) = [132]> then\n    Spawn [Key 4] at [134] [54] dir [90]\nend\nif <(SCENE #) = [131]> then\n    Spawn [Key 5] at [-126] [61] dir [90]\nend\nif <(SCENE #) = [136]> then\n    Spawn [Key 6] at [-111] [83] dir [90]\nend\nif <(SCENE #) = [107]> then\n    switch costume to (platform v)\n    show\n    Animate Platform 1\nend\nif <(SCENE #) = [15]> then\n    switch costume to (platform v)\n    show\n    Animate Platform 2\nend\nif <(SCENE #) = [16]> then\n    switch costume to (platform v)\n    show\n    Animate Platform 3\nend\n\ndefine Animate Platform 1\nshow\npoint in direction (90)\nforever\n    glide (0.5) secs to x: (-73) y: (-90)\n    wait (1) seconds\n    glide (0.5) secs to x: (79) y: (-90)\n    wait (1) seconds\nend\n\ndefine Animate Platform 2\nshow\npoint in direction (90)\ngo to x: (128) y: (-64)\nforever\n    glide (1) secs to x: (128) y: (-64)\n    wait (1) seconds\n    glide (1) secs to x: (-101) y: (-64)\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 Door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (30)\n            change y by (4)\n        end\n        wait (0.5) 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\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\ndefine Animate Platform 3\ngo to x: (-127) y: (-88)\nshow\npoint in direction (90)\nwait (2) seconds\nforever\n    glide (2) secs to x: (-127) y: (-88)\n    wait (1) seconds\n    glide (2) secs to x: (-127) y: (65)\n    wait (1) seconds\n    glide (2) secs to x: (97) y: (65)\n    wait (1) seconds\n    glide (2) secs to x: (106) y: (-82)\n    wait (1) seconds\n    glide (2) secs to x: (208) y: (-82)\n    wait (1) seconds\n    glide (2) secs to x: (106) y: (-82)\n    wait (1) seconds\n    glide (2) secs to x: (97) y: (65)\n    wait (1) seconds\n    glide (2) secs to x: (-127) y: (65)\n    wait (1) seconds\n    glide (2) secs to x: (-127) y: (-88)\n    wait (1) seconds\nend\n\ndefine Animate Platform 4\nshow\nforever\n    glide (1) secs to x: (x position) y: ((y position) - (90))\n    wait (0.01) seconds\n    glide (1) secs to x: (x position) y: ((y position) + (90))\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif < (costume [name v]) contains [Key]?> then\n    Door at (x position) (y position) key (costume [name v])\nend\n\n@Collectables\n\nwhen I receive [change scene v]\nif <(SCENE #) = (my scene)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nrepeat until <touching (player v)?>\n    change y by ((0.5) * ([sin v] of (frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [apple]> then\n    start sound [Chomp v]\n    change [apples v] by (1)\nelse\n    if <(costume [name v]) = [Green Flag]> then\n        start sound [Collect v]\n        set [spawn scene v] to (SCENE #)\n        set [spawn x v] to ([x position v] of [player v])\n        set [spawn y v] to ([y position v] of [player v])\n    else\n        if <(costume [name v]) = [OneMoreLife]> then\n            start sound [Collect v]\n            change [lives v] by (1)\n        else\n            start sound [Wand v]\n            add (costume [name v]) to [collected 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 [setup v]\ndelete all of [collected v]\nset [apples v] to [0]\nset [frame v] to [0]\nhide\nPlace [apple] Scene [1] x, y [161] [-51]\nPlace [apple] Scene [1] x, y [-50] [40]\nPlace [apple] Scene [2] x, y [9] [-76]\nPlace [apple] Scene [103] x, y [-151] [-70]\nPlace [apple] Scene [103] x, y [-151] [57]\nPlace [Key 1] Scene [103] x, y [158] [-58]\nPlace [apple] Scene [5] x, y [92] [-48]\nPlace [Green Flag] Scene [2] x, y [156] [-65]\nPlace [Green Flag] Scene [4] x, y [98] [-4]\nPlace [Key 2] Scene [204] x, y [-98] [-20]\nPlace [apple] Scene [204] x, y [130] [60]\nPlace [OneMoreLife] Scene [204] x, y [-99] [101]\nPlace [Green Flag] Scene [206] x, y [98] [-5]\nPlace [apple] Scene [6] x, y [-200] [-35]\nPlace [apple] Scene [6] x, y [-160] [-35]\nPlace [apple] Scene [6] x, y [-120] [-35]\nPlace [apple] Scene [6] x, y [-80] [-35]\nPlace [apple] Scene [6] x, y [-40] [-35]\nPlace [apple] Scene [6] x, y [0] [-35]\nPlace [apple] Scene [6] x, y [40] [-35]\nPlace [apple] Scene [6] x, y [80] [-35]\nPlace [apple] Scene [6] x, y [-200] [15]\nPlace [apple] Scene [6] x, y [-160] [15]\nPlace [apple] Scene [6] x, y [-120] [15]\nPlace [apple] Scene [6] x, y [-80] [15]\nPlace [apple] Scene [6] x, y [-40] [15]\nPlace [apple] Scene [6] x, y [0] [15]\nPlace [apple] Scene [6] x, y [40] [15]\nPlace [apple] Scene [6] x, y [80] [15]\nPlace [apple] Scene [104] x, y [-46] [117]\nPlace [apple] Scene [104] x, y [-7] [117]\nPlace [apple] Scene [104] x, y [32] [117]\nPlace [apple] Scene [8] x, y [-112] [35]\nPlace [apple] Scene [8] x, y [-26] [58]\nPlace [apple] Scene [8] x, y [65] [58]\nPlace [apple] Scene [8] x, y [147] [35]\nPlace [OneMoreLife] Scene [11] x, y [70] [-103]\nPlace [OneMoreLife] Scene [9] x, y [181] [-26]\nPlace [Green Flag] Scene [10] x, y [150] [-116]\nPlace [Green Flag] Scene [14] x, y [186] [-30]\nPlace [Green Flag] Scene [17] x, y [-198] [-30]\nPlace [Green Flag] Scene [20] x, y [-212] [117]\nPlace [Green Flag] Scene [27] x, y [-208] [-56]\nPlace [Key 3] Scene [126] x, y [-172] [-102]\nPlace [Key 4] Scene [131] x, y [-174] [73]\nPlace [Green Flag] Scene [28] x, y [-169] [112]\nPlace [apple] Scene [15] x, y [-198] [-27]\nPlace [apple] Scene [15] x, y [198] [-27]\nPlace [apple] Scene [16] x, y [-89] [6]\nPlace [apple] Scene [16] x, y [101] [6]\nPlace [apple] Scene [17] x, y [-23] [-29]\nPlace [apple] Scene [18] x, y [3] [67]\nPlace [apple] Scene [118] x, y [3] [67]\nPlace [apple] Scene [218] x, y [3] [67]\nPlace [apple] Scene [318] x, y [3] [67]\nPlace [apple] Scene [418] x, y [3] [67]\nPlace [apple] Scene [518] x, y [126] [91]\nPlace [apple] Scene [519] x, y [-81] [76]\nPlace [apple] Scene [21] x, y [75] [75]\nPlace [apple] Scene [22] x, y [8] [-8]\nPlace [apple] Scene [23] x, y [8] [-8]\nPlace [apple] Scene [24] x, y [-80] [-39]\nPlace [apple] Scene [24] x, y [86] [-39]\nPlace [Key 5] Scene [31] x, y [60] [0]\nPlace [Key 6] Scene [34] x, y [-39] [99]\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 flag clicked\nshow list [collected v]\n\nwhen I receive [reset game v]\ndelete this clone\n\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\nPlace [] Scene [] x, y [] []\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 game v]\nhide\n\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (0) y: (-85)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Start Game v)\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [change scene v]\nif <(SCENE #) = [1]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [202] [-110] dir [-90]\n    else\n        Spawn [Red] at [87] [-110] dir [90]\n    end\n    Spawn [Red] at [0] [20] dir [-90]\nend\nif <(SCENE #) = [4]> then\n    Spawn [Red] at [31] [-24] dir [-90]\nend\nif <(SCENE #) = [103]> then\n    Spawn [Red] at [193] [-70] dir [-90]\nend\n\nwhen I start as a clone\nshow\nset [enemy: 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\nend\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine Move - Down\nchange [enemy: speed y v] by (-1)\nchange y by (Enemy: Speed y)\nrepeat until <not <touching (level v)?>>\n    change y by (1)\n    set [enemy: speed y v] to [0]\nend\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 (platform  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 <([player: 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.1) 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\n@Safe Zones\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (100)\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (thumbnail2 v)\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (thumbnail1 v)\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (thumbnail3 v)\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (thumbnail4 v)\n\n@Restart Button\n\nwhen flag clicked\ngo to x: (-206) y: (-148)\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nbroadcast (Main Menu v)\n\n@Music Button\n\nwhen flag clicked\nset size to (100) %\nswitch costume to (music button on v)\ngo to [front v] layer\nwait (1) seconds\nshow\ngo to x: (-154) y: (-146)\nset [is music looping? v] to [no]\nset size to (100) %\nbroadcast (Start Loop v)\n\nwhen this sprite clicked\nif <(is music looping?) = [no]> then\n    broadcast (Start Loop v)\n    start sound [Pop v]\n    switch costume to (music button on v)\nelse\n    stop [other scripts in sprite v]\n    stop all sounds\n    set [is music looping? v] to [no]\n    switch costume to (music button off v)\nend\n\nwhen I receive [start loop v]\nset [is music looping? v] to [yes]\nforever\n    play sound [TheFatRat - Unity v] until done\nend\n\nwhen I receive [game over v]\nstop all sounds\n\n@Love, fav, follow\n\nwhen flag clicked\nhide\ngo to x: (-6) y: (105)\n\nwhen flag clicked\nhide\ngo to [front v] layer\nforever\n    wait (pick random (3) to (5)) seconds\n    switch costume to (costume1 v)\n    go to x: (0) y: (105)\n    show\n    go to [front v] layer\n    repeat (10)\n        change y by (-6)\n    end\n    repeat (6)\n        change y by (3)\n    end\n    repeat (6)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (16)\n        change y by (7)\n    end\n    hide\nend\n\n