Zombie Escape Platformer

Instructions: You wake up in a city building, but there's something wrong...\n\n- WASD, arrow keys, or touchscreen.\n- Press down to fall through platforms.\n- You can't kill enemies, you can only jump on them!\n- Climb objects to get to the top floor.

@Stage\n\nwhen flag clicked\nforever\n    play sound [Rain v] until done\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nforever\n    play sound [young and old know love v] until done\nend\n\nwhen flag clicked\nforever\n    if <(playerTouchingWater) = [1]> then\n        set [pitch v] effect to (-50)\n    else\n        set [pitch v] effect to (0)\n        set [pan left/right v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(playerTouchingWater) = [1]> then\n        repeat (50)\n            change [pan left/right v] effect by (-2)\n        end\n        repeat (100)\n            change [pan left/right v] effect by (2)\n        end\n        repeat (50)\n            change [pan left/right v] effect by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Thunder Storm v] until done\n    wait (pick random (30) to (75)) seconds\nend\n\nwhen flag clicked\nforever\n    play sound [JJ v] until done\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset rotation style [left-right v]\nset [checkpoint v] to [0]\nif <not <(username) = [AzureLightning]>> then\n    change [☁ plays v] by (1)\nend\nset [currenttime v] to [0]\nset [xscroll v] to [-100]\nset [playercoins v] to [0]\nset [yscroll v] to [-63]\nset [playercharacter v] to [Swift]\nset [gravity v] to [Normal]\nset [framesbeforecloningplayer v] to [5]\nset [cancontrolplayer v] to [1]\nset [xspeed v] to [0]\nset [yspeed v] to [0]\nbroadcast (Setup v) and wait\nbroadcast (loadPlaceholder v) and wait\nset [playerhealth v] to [3]\nbroadcast (updateHealth v) and wait\nforever\n    if <(paused) = [0]> then\n        change [currenttime v] by (1)\n        if <(playerCoins) = [9]> then\n            if <not <(username) = [AzureLightning]>> then\n                set [☁ globalaveragetime v] to (((☁ globalAverageTime) + (currentTime)) / (2))\n            end\n            broadcast (Win v) and wait\n        end\n        if <(playerHealth) = [0]> then\n            start sound [Ricochet v]\n            if <not <(username) = [AzureLightning]>> then\n                change [☁ deaths v] by (1)\n            end\n            set [yspeed v] to [15]\n            repeat until <touching (_edge_ v)?>\n                change [yspeed v] by (-1)\n                change y by (ySpeed)\n                if <(direction) = [90]> then\n                    change x by (-2)\n                else\n                    change x by (2)\n                end\n            end\n            broadcast (lose v) and wait\n            go to x: (0) y: (0)\n            set rotation style [left-right v]\n            set [xscroll v] to [0]\n            set [playercoins v] to [0]\n            set [yscroll v] to [50]\n            set [playercharacter v] to [Swift]\n            set [gravity v] to [Normal]\n            set [framesbeforecloningplayer v] to [5]\n            set [cancontrolplayer v] to [1]\n            set [xspeed v] to [0]\n            set [yspeed v] to [0]\n            broadcast (Setup v) and wait\n            broadcast (loadPlaceholder v) and wait\n            set [playerhealth v] to [3]\n            broadcast (updateHealth v) and wait\n        end\n        if <(cheatFlight) = [1]> then\n            set [availablejumps v] to [999999999999]\n        end\n        if <(yScroll) > [600]> then\n            set [checkpoint v] to [1]\n        end\n        controls: <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(analog to x input) < [-.4]>> <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(analog to x input) > [.4]>> <<((yLengthWithinBounds) / (slingMaxLength)) > [.5]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> <<((yLengthWithinBounds) / (slingMaxLength)) < [-.7]> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>> gravity [2] jump speed [disabled as of now] amount of jumps [] move speed []\n    end\nend\n\nchange [framesbeforecloningplayer v] by (-1)\nif <(framesBeforeCloningPlayer) = [0]> then\n    set [spriteisclone v] to [1]\n    set [cloneframecounter v] to [0]\n    set [clonex v] to (xScroll)\n    set [cloney v] to (y position)\n    create clone of (_myself_ v)\n    set [spriteisclone v] to [0]\n    set [framesbeforecloningplayer v] to [3]\nend\n\ndefine Change X (x speed) <up >\nset [slopelimit v] to [15]\nset [slope v] to [0]\nif <(touchingFloor) = [1]> then\n    change x by (x speed)\n    if <touching (platforms v)?> then\n        repeat until <<not <touching (platforms v)?>> or <(slope) = (slopeLimit)>>\n            change y by (1)\n            change [slope v] by (1)\n        end\n    end\n    if <(slope) = (slopeLimit)> then\n        change y by (() - (slope))\n        set [xspeed v] to [0]\n        X Collision Without Slope (x speed) <up >\n    end\n    change y by (-15)\n    if <<touching (platforms v)?> or <touching (semisolid platforms v)?>> then\n        repeat until <not <<touching (platforms v)?> or <touching (semisolid platforms v)?>>>\n            change y by (1)\n        end\n    else\n        change y by (15)\n        set [availablejumps v] to [1]\n    end\nelse\n    change x by (x speed)\n    if <touching (platforms v)?> then\n        set [xspeed v] to [0]\n        X Collision Without Slope (x speed) <up >\n    end\nend\n\ndefine Change Y (y speed)\nset [availablejumps v] to [0]\nchange y by (ySpeed)\nset [touchingfloor v] to [0]\nif <touching (platforms v)?> then\n    if <<touching (platforms v)?> or <(ySpeed) < [0]>> then\n        set [yspeed v] to [0]\n    end\n    if <<(y speed) > [0]> or <(y speed) = [0]>> then\n        repeat until <not <touching (platforms v)?>>\n            change y by (-1)\n        end\n    else\n        set [touchingfloor v] to [1]\n        set [framesmidair v] to [0]\n        set [availablejumps v] to [1]\n        repeat until <not <touching (platforms v)?>>\n            change y by (1)\n        end\n    end\nend\nif <touching (water v)?> then\n    set [framesmidair v] to [0]\nend\nif <not <(phaseThrough) > [0]>> then\n    if <(ySpeed) < [-6]> then\n        switch costume to (semisolid fall v)\n    else\n        switch costume to (semisolid hitbox v)\n    end\n    if <<(ySpeed) < [0]> and <touching (semisolid platforms v)?>> then\n        set [touchingfloor v] to [1]\n        set [semisolidcounter v] to [0]\n        repeat until <not <touching (semisolid platforms v)?>>\n            change y by (1)\n            change [semisolidcounter v] by (1)\n        end\n        if <<(semisolidCounter) > [10]> and <(ySpeed) > [-10]>> then\n            change y by (() - (semisolidCounter))\n        else\n            set [yspeed v] to [0]\n            set [availablejumps v] to [1]\n        end\n    end\n    switch costume to (hitbox v)\nend\n\ndefine X Collision Without Slope (x speed) <up>\nif <(x speed) > [0]> then\n    repeat until <not <touching (platforms v)?>>\n        change x by (-1)\n    end\nelse\n    repeat until <not <touching (platforms v)?>>\n        change x by (1)\n    end\nend\n\ndefine playerAnimations <left> <right>\nif <(playerTurning) > [0]> then\n    change [playerturning v] by (-1)\nend\nif <(playerTurning) > [0]> then\n    switch costume to (turn v)\nelse\n    if <<(ySpeed) < [-16]> or <<touching (water v)?> and <(ySpeed) < [-5]>>> then\n        switch costume to (fall v)\n    else\n        switch costume to (forward v)\n    end\n    if <left> then\n        point in direction (-90)\n    end\n    if <right> then\n        point in direction (90)\n    end\nend\n\nwhen I receive [scroll v]\ngo to [front v] layer\ngo [backward v] (9) layers\n\nif <(spriteIsClone) = [1]> then\n    go to [back v] layer\n    go to x: ((cloneX) - (xScroll)) y: ((cloneY) - (yScroll))\n    change [ghost v] effect by (10)\n    set size to ((size) * (.99)) %\n    change [cloneframecounter v] by (1)\n    if <(cloneFrameCounter) = [10]> then\n        delete this clone\n    end\nend\n\ndefine controls: <left> <right> <up> <down> gravity (gravity) jump speed (jump speed) amount of jumps (amount of jumps) move speed (move speed)\nswitch costume to (hitbox v)\nif <<right> and <(canControlPlayer) = [1]>> then\n    if <(xSpeed) < [0]> then\n        set [playerturning v] to [3]\n    end\n    change [xspeed v] by (3)\nend\nif <<left> and <(canControlPlayer) = [1]>> then\n    if <(xSpeed) > [0]> then\n        set [playerturning v] to [3]\n    end\n    change [xspeed v] by (-3)\nend\nif <not <(canControlPlayer) = [1]>> then\n    change [cancontrolplayer v] by (1)\nend\nif <(xSpeed) > [8]> then\n    set [xspeed v] to [8]\nelse\n    if <(xSpeed) < [-8]> then\n        set [xspeed v] to [-8]\n    end\nend\nChange X (xSpeed) <up>\nif <(touchingFloor) = [1]> then\n    if <(xSpeed) > [0]> then\n        change [xspeed v] by (-1)\n    else\n        if <(xSpeed) < [0]> then\n            change [xspeed v] by (1)\n        end\n    end\nend\nif <touching (water v)?> then\n    if <(playerTouchingWater) = [0]> then\n        start sound [Water Drop v]\n    end\n    set [playertouchingwater v] to [1]\n    change [yspeed v] by (-1)\n    if <(ySpeed) < [-6]> then\n        set [yspeed v] to [-6]\n    end\nelse\n    change [yspeed v] by (() - (gravity))\n    set [playertouchingwater v] to [0]\nend\nchange [framesmidair v] by (1)\nif <<(cheatFlight) = [1]> and <(ySpeed) < [-6]>> then\n    set [yspeed v] to [-6]\nend\nChange Y (ySpeed)\nif <up> then\n    if <<<(availableJumps) > [0]> or <touching (water v)?>> and <<<(cheatFlight) = [1]> or <(jumpKeyHeld) = [0]>> or <touching (water v)?>>> then\n        set [jumpkeyheld v] to [1]\n        if <(canControlPlayer) = [1]> then\n            if <touching (water v)?> then\n                set [yspeed v] to [10]\n            else\n                set [yspeed v] to [19]\n                if <(cheatFlight) = [1]> then\n                    set [yspeed v] to [10]\n                else\n                    start sound [Low Whoosh v]\n                end\n                if <(availableJumps) = [1]> then\n                    if <<<right> and <(xSpeed) < [0]>> or <<left> and <(xSpeed) > [0]>>> then\n                        set [xspeed v] to [0]\n                    end\n                end\n            end\n            set [availablejumps v] to [0]\n        end\n    end\nelse\n    set [jumpkeyheld v] to [0]\nend\nplayerAnimations <left> <right>\nif <<not <<(x position) < [0]> and <(xScroll) < [-110]>>> and <not <<(x position) > [0]> and <(xScroll) > [300]>>>> then\n    change [xscroll v] by (x position)\n    set x to (0)\nend\nif <<not <<(yScroll) < [-20]> and <(y position) < [0]>>> and <not <<(yScroll) > [1750]> and <(y position) > [0]>>>> then\n    change [yscroll v] by (y position)\n    set y to (0)\nend\nif <(phaseThrough) > [0]> then\n    change [phasethrough v] by (-1)\nend\nif <(playerInvincible) > [0]> then\n    change [playerinvincible v] by (-1)\nend\nif <down> then\n    set [phasethrough v] to [4]\nend\nbroadcast (Scroll v) and wait\n\n\n\nif  then\n\n\n\nif <<up> and <(framesMidair) > [5]>> then\n    set [yspeed v] to [15]\n    set [xspeed v] to [-18]\n    if <<(xLengthWithinBounds) = [0]> and <(yLengthWithinBounds) = [0]>> then\n        set [cancontrolplayer v] to [-5]\n    end\n    start sound [Tap Conga v]\nend\n\nwhen I receive [lose v]\ndelete this clone\n\nif <<up> and <(framesMidair) > [5]>> then\n    set [yspeed v] to [20]\n    set [xspeed v] to [-10]\n    if <<(xLengthWithinBounds) = [0]> and <(yLengthWithinBounds) = [0]>> then\n        set [cancontrolplayer v] to [-7]\n    end\n    start sound [Tap Conga v]\nend\n\nif <<up> and <(framesMidair) > [5]>> then\n    set [yspeed v] to [20]\n    set [xspeed v] to [10]\n    if <<(xLengthWithinBounds) = [0]> and <(yLengthWithinBounds) = [0]>> then\n        set [cancontrolplayer v] to [-7]\n    end\n    start sound [Tap Conga v]\nend\n\nwhen flag clicked\nforever\n    if <<not <(xSpeed) = [0]>> and <(touchingFloor) = [1]>> then\n        play sound (pick random (7) to (12)) until done\n    end\nend\n\nwhen I receive [win v]\nset [xspeed v] to [0]\n\nwhen I receive [win v]\nchange [☁ wins v] by (1)\n\n@Characters\n\nwhen I receive [scroll v]\nif <(characterIsClone) = [1]> then\n    switch costume to (costume2 v)\n    go to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\n    if <(characterHealth) = [0]> then\n        switch costume to (join (characterColor) [Turn])\n        change [ghost v] effect by (10)\n        change [characterfade v] by (1)\n        if <(characterFade) > [9]> then\n            delete this clone\n        end\n    else\n        if <<<(x position) > [-225]> and <(x position) < [225]>> and <<(y position) > [-155]> and <(y position) < [155]>>> then\n            show\n            switch costume to (hitbox v)\n            change [characteryspeed v] by (-1)\n            Y Collision\n            if <<touching (water v)?> and <(characterStatus) = [enemy]>> then\n                if <([y position v] of [player v]) > (y position)> then\n                    set [characteryspeed v] to [2]\n                else\n                    if <(characterYSpeed) < [-6]> then\n                        set [characteryspeed v] to [-6]\n                    end\n                end\n            end\n            if <([y position v] of [player v]) > ((y position) - (90))> then\n                if <(x position) > ([x position v] of [player v])> then\n                    if <(direction) = [90]> then\n                        set [characterturning v] to [6]\n                    end\n                    point in direction (-90)\n                else\n                    if <(direction) = [-90]> then\n                        set [characterturning v] to [6]\n                    end\n                    point in direction (90)\n                end\n            end\n            if <<<<touching (player v)?> and <([abs v] of ((x position) - ([x position v] of [player v])) ) > [20]>> and <<(touchingFloor) = [1]> and <(characterStatus) = [friendly]>>> and <(cheatFriendlyFire) = [1]>> then\n                if <(xSpeed) > [0]> then\n                    Slope and X Collision ((xSpeed) + (1))\n                else\n                    if <(xSpeed) < [0]> then\n                        Slope and X Collision ((xSpeed) - (1))\n                    end\n                end\n            end\n            if <<<([y position v] of [player v]) > ((y position) - (90))> and <([abs v] of ((x position) - ([x position v] of [player v])) ) > [20]>> and <<<(x position) > [-240]> and <(x position) < [240]>> and <<(characterStatus) = [enemy]> and <(characterTurning) = [0]>>>> then\n                if <(x position) > ([x position v] of [player v])> then\n                    Slope and X Collision [-3]\n                else\n                    Slope and X Collision [3]\n                end\n            end\n            if <(jumpedOnAnimation) > [0]> then\n                switch costume to (join (characterColor) [Jumped])\n                if <(characterTurning) > [0]> then\n                    switch costume to (join (characterColor) [JumpedTurn])\n                end\n                change [jumpedonanimation v] by (-1)\n                if <(jumpedOnAnimation) = [1]> then\n                    if <(characterHealth) = [0]> then\n                end\n            else\n                if <(characterTurning) > [0]> then\n                    switch costume to (join (characterColor) [Turn])\n                    change [characterturning v] by (-1)\n                else\n                    switch costume to (join (characterColor) [Forward])\n                end\n            end\n            if <<([abs v] of ((x position) - ([x position v] of [player v])) ) < [100]> and <(jumpedOnAnimation) = [0]>> then\n                if <([abs v] of ((y position) - ([y position v] of [player v])) ) < [30]> then\n                    if <(characterSpeechDelay) > [0]> then\n                        change [characterspeechdelay v] by (-1)\n                    else\n                        say (characterText)\n                    end\n                end\n                if <<<touching (player v)?> and <<(ySpeed) < [0]> and <([y position v] of [player v]) > (y position)>>> and <(jumpedOnAnimation) = [0]>> then\n                    set [yspeed v] to [18]\n                    set [playerinvincible v] to [5]\n                    if <(characterStatus) = [enemy]> then\n                        set [jumpedonanimation v] to [4]\n                    else\n                        set [jumpedonanimation v] to [8]\n                    end\n                    if <<(characterStatus) = [enemy]> or <<(characterStatus) = [friendly]> and <(cheatFriendlyFire) = [1]>>> then\n                        change [characterhealth v] by (-1)\n                    end\n                    set [characterspeechdelay v] to [20]\n                    if <(x position) > ([x position v] of [player v])> then\n                        point in direction (-90)\n                    else\n                        point in direction (90)\n                    end\n                    start sound [Boing v]\n                    if <(characterHealth) = [0]> then\n                        start sound [Magic Spell v]\n                    end\n                end\n            else\n                say []\n            end\n            if <<<(jumpedOnAnimation) = [0]> and <(characterStatus) = [enemy]>> and <<touching (player v)?> and <(playerInvincible) = [0]>>> then\n                set [playerinvincible v] to [10]\n                start sound [Crunch v]\n                if <(x position) > ([x position v] of [player v])> then\n                    set [xspeed v] to [-10]\n                    set [yspeed v] to [13]\n                    set [cancontrolplayer v] to [-5]\n                else\n                    set [xspeed v] to [10]\n                    set [yspeed v] to [13]\n                    set [cancontrolplayer v] to [-5]\n                end\n                if <(cheatInvincibility) = [0]> then\n                    change [playerhealth v] by (-1)\n                end\n                if <not <(playerHealth) = [0]>> then\n                    set [redvignettelifetime v] to [10]\n                end\n                broadcast (updateHealth v) and wait\n            end\n        else\n            switch costume to (join (characterColor) [Forward])\n        end\n    end\nend\n\nwhen I receive [loadplaceholder v]\nset [characterisclone v] to [0]\nCreate [4] at [100] [380] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [340] [380] with text [] from distance [] status [enemy] health [999] color [yellow]\nCreate [4] at [300] [710] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [300] [920] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [300] [1012] with text [] from distance [] status [enemy] health [999] color [yellow]\nCreate [4] at [75] [1200] with text [] from distance [] status [enemy] health [999] color [yellow]\nCreate [4] at [175] [1200] with text [] from distance [] status [enemy] health [999] color [yellow]\nCreate [4] at [175] [1470] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [300] [1470] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [300] [1550] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [-150] [1700] with text [] from distance [] status [enemy] health [999] color [green]\nCreate [4] at [0] [1760] with text [] from distance [] status [enemy] health [999] color [green]\n\ndefine Create (character) at (x) (y) with text (text) from distance (distance) status (status) health (health) color (color)\nset rotation style [left-right v]\nset [groundxpos v] to (x)\nset [characterypos v] to (y)\nset [charactertext v] to (text)\nset [characterturning v] to [0]\nset [characterspeechdelay v] to [0]\nset [characterstatus v] to (status)\nset [characterhealth v] to (health)\nset [charactercolor v] to (color)\nset [characterfade v] to [0]\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\nswitch costume to (join (characterColor) [Turn])\nset [characterisclone v] to [1]\n\nchange [groundxpos v] by (2)\ngo to x: ((groundXPos) - (xScroll)) y: (characterYPos)\nchange [groundxpos v] by (-2)\ngo to x: ((groundXPos) - (xScroll)) y: (characterYPos)\n\ndefine Slope and X Collision (speed)\nset [characterslope v] to [0]\nchange [groundxpos v] by (speed)\ngo to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\nrepeat until <<not <touching (platforms v)?>> or <(characterSlope) = [10]>>\n    change [characterypos v] by (1)\n    change [characterslope v] by (1)\n    go to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\nend\nif <(characterSlope) = [10]> then\n    change [groundxpos v] by (() - (speed))\n    change [characterypos v] by (() - (characterSlope))\n    go to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\nend\n\ndefine Y Collision\nchange [characterypos v] by (characterYSpeed)\ngo to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\nif <<touching (platforms v)?> or <touching (semisolid platforms v)?>> then\n    if <(characterYSpeed) > [0]> then\n        repeat until <not <<touching (platforms v)?> or <touching (semisolid platforms v)?>>>\n            change [characterypos v] by (-1)\n            go to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\n        end\n    else\n        repeat until <not <<touching (platforms v)?> or <touching (semisolid platforms v)?>>>\n            change [characterypos v] by (1)\n            go to x: ((groundXPos) - (xScroll)) y: ((characterYPos) - (yScroll))\n        end\n    end\n    set [characteryspeed v] to [0]\nend\n\nwhen I receive [pause v]\nsay []\n\nwhen flag clicked\nhide\n\nCreate [4] at [550] [71] with text [] from distance [] status [enemy] health [1] color [red]\nCreate [4] at [450] [-120] with text [] from distance [] status [enemy] health [1] color [red]\nCreate [4] at [500] [-120] with text [] from distance [] status [enemy] health [1] color [red]\nCreate [4] at [1500] [-120] with text [] from distance [] status [friendly] health [3] color [blue]\nCreate [4] at [1600] [-120] with text [] from distance [] status [friendly] health [2] color [yellow]\n\nCreate [4] at [1000] [-27] with text [] from distance [] status [enemy] health [2] color [red]\n\nwhen I receive [lose v]\ndelete this clone\n\nCreate [4] at [175] [71] with text [You can double jump in this game!] from distance [] status [friendly] health [2] color [green]\nCreate [4] at [-210] [-50] with text [Isn't the view nice?] from distance [] status [friendly] health [4] color [yellow]\nCreate [4] at [900] [-200] with text [] from distance [] status [enemy] health [2] color [red]\nCreate [4] at [2575] [270] with text [Nice! You made it up!] from distance [] status [friendly] health [2] color [yellow]\nCreate [4] at [2500] [0] with text [Have you tried jumping on top of trees?] from distance [] status [friendly] health [4] color [blue]\nCreate [4] at [2300] [0] with text [] from distance [] status [enemy] health [2] color [red]\nCreate [4] at [2400] [0] with text [] from distance [] status [enemy] health [2] color [red]\n\nhide\n\n@Coins\n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to (x)\nset [groundcostume v] to (costume)\nset [yposition v] to (y)\nset [coinfade v] to [0]\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [setup v]\nCreate [2] at [-115] [1870]\nCreate [3] at [-115] [1870]\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\n\nCreate [2] at [0] [0]\nCreate [3] at [1] [0]\nCreate [4] at [2] [0]\nCreate [5] at [3] [0]\n\nwhen I receive [scroll v]\nif <(groundCostume) = [1]> then\n    switch costume to (costume2 v)\n    go to x: ((groundXPos) - (xScroll)) y: (((yPosition) + ((3) * ([cos v] of (((450) * (timer)) - ()) ))) - (yScroll))\n    switch costume to (costume1 v)\n    if <<touching (player v)?> and <(coinFade) = [0]>> then\n        set [coinfade v] to [1]\n        change [playercoins v] by (1)\n        start sound [coin v]\n        change [playerhealth v] by (1)\n        if <(playerHealth) > [3]> then\n            set [playerhealth v] to [3]\n        else\n            broadcast (updateHealth v) and wait\n        end\n    end\n    if <(coinFade) > [0]> then\n        change [coinfade v] by (1)\n        change [yposition v] by (5)\n        change [ghost v] effect by (10)\n        if <(coinFade) > [9]> then\n            delete this clone\n        end\n    end\nelse\n    if <(groundCostume) = [3]> then\n        set [ghost v] effect to (100)\n        switch costume to (costume2 v)\n        go to x: ((groundXPos) - (xScroll)) y: (((yPosition) + ((3) * ([cos v] of (((450) * (timer)) - ()) ))) - (yScroll))\n        switch costume to (costume4 v)\n        go to [front v] layer\n        go [backward v] (19) layers\n    else\n        switch costume to (costume2 v)\n        go to x: ((groundXPos) - (xScroll)) y: (((yPosition) + ((3) * ([cos v] of (((450) * (timer)) - ()) ))) - (yScroll))\n        switch costume to (costume3 v)\n        point in direction (90)\n        set [ghost v] effect to (100)\n        if <touching (player v)?> then\n            set [paused v] to [1]\n            broadcast (Win v)\n        end\n    end\nend\n\nwhen I receive [lose v]\ndelete this clone\n\nCreate [7] at [1] [0]\nCreate [8] at [2] [0]\n\nCreate [1] at [-1] [-175]\nCreate [1] at [2.1] [-230]\nCreate [1] at [1] [165]\nCreate [1] at [2.84] [0]\nCreate [1] at [0] [260]\nCreate [1] at [5.5] [300]\nCreate [1] at [4.4] [200]\n\nwhen I receive [lose v]\ndelete this clone\n\n@Platforms\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (((-20) + (groundYPos)) - (yScroll))\nswitch costume to (groundCostume)\nshow\n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to ((x) * (480))\nset [groundcostume v] to (costume)\nset [groundypos v] to (y)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [loadplaceholder v]\nCreate [6] at [0] [0]\nCreate [7] at [1] [0]\nCreate [8] at [0] [341]\nCreate [9] at [1] [341]\nCreate [8] at [0] [682]\nCreate [9] at [1] [682]\nCreate [8] at [0] [1023]\nCreate [9] at [1] [1023]\nCreate [8] at [0] [1364]\nCreate [9] at [1] [1364]\nCreate [8] at [0] [1706]\nCreate [9] at [1] [1705]\nCreate [8] at [0] [2047]\nCreate [9] at [1] [2047]\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\nhide\n\nCreate [2] at [0] [0]\nCreate [3] at [1] [0]\nCreate [4] at [2] [0]\nCreate [5] at [3] [0]\n\nwhen I receive [lose v]\ndelete this clone\n\nwhen I receive [loadplaceholder v]\nCreate [10] at [0] [1525]\n\nCreate [8] at [2] [0]\nCreate [9] at [3] [0]\nCreate [10] at [4] [0]\nCreate [11] at [5] [0]\n\nCreate [7] at [1] [0]\n\n@Semisolid Platforms\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (((-20) + (semisolidY)) - (yScroll))\nswitch costume to (groundCostume)\n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to (x)\nset [groundcostume v] to (costume)\nset [semisolidy v] to (y)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [setup v]\nCreate [6] at [50] [0]\nCreate [7] at [50] [230]\nCreate [8] at [50] [460]\nCreate [9] at [50] [690]\nCreate [10] at [50] [920]\nCreate [11] at [50] [1150]\nCreate [12] at [50] [1380]\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\n\nCreate [2] at [0] [0]\nCreate [3] at [1] [0]\nCreate [4] at [2] [0]\nCreate [5] at [3] [0]\n\nwhen I receive [lose v]\ndelete this clone\n\nCreate [7] at [1] [0]\nCreate [8] at [2] [0]\nCreate [9] at [3] [0]\nCreate [10] at [4] [0]\n\n@Water\n\nwhen I receive [setup v]\nset [ghost v] effect to (30)\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: (0) y: ((1507) - (yScroll))\nswitch costume to (costume1 v)\n\nwhen I receive [lose v]\ndelete this clone\n\n@Background\n\nwhen I receive [loadplaceholder v]\nhide\ncreate [2] at [100] [0]\ncreate [3] at [100] [230]\ncreate [4] at [100] [460]\ncreate [5] at [100] [690]\ncreate [6] at [100] [920]\ncreate [7] at [100] [1150]\ncreate [8] at [100] [1380]\ncreate [9] at [100] [1610]\ncreate [10] at [100] [1840]\n\nwhen I receive [scroll v]\nswitch costume to (1 v)\ngo to x: ((backgroundX) - (xScroll)) y: ((backgroundY) - (yScroll))\nswitch costume to (backgroundCostume)\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen I receive [lose v]\ndelete this clone\n\nwhen I start as a clone\nshow\n\ndefine create (costume) at (x) (y)\nset [backgroundx v] to (x)\nset [backgroundy v] to (y)\nset [backgroundcostume v] to (costume)\ncreate clone of (_myself_ v)\n\ncreate [bottom] at [100] [0]\n\n@Clouds\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: (() - ((xScroll) / (1.5))) y: ((750) - ((yScroll) / (1.5)))\nswitch costume to (groundCostume)\ngo to [back v] layer\n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to ((x) * (480))\nset [groundcostume v] to (costume)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [setup v]\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\n\nwhen I receive [lose v]\ndelete this clone\n\n@Sprite3\n\nwhen I receive [scroll v]\nif <(redVignetteLifetime) > [0]> then\n    change [redvignettelifetime v] by (-1)\n    change [ghost v] effect by (-20)\nelse\n    change [ghost v] effect by (20)\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@Health\n\nwhen flag clicked\nhide\n\nwhen I receive [updatehealth v]\nif <(cheatInvincibility) = [0]> then\n    broadcast (deleteHealth v) and wait\n    noScreenRefresh\nend\n\nwhen I receive [deletehealth v]\nif <(cheatInvincibility) = [0]> then\n    delete this clone\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nif <(heartIsClone) = [1]> then\n    set y to ((-140) + ((2) * ([cos v] of (((450) * (timer)) - (x position)) )))\n    go to [front v] layer\nelse\n    switch costume to (costume4 v)\n    go to x: (0) y: (-140)\nend\n\ndefine noScreenRefresh\nhide\nswitch costume to (costume2 v)\ngo to x: (-200) y: (140)\nset [heartisclone v] to [1]\nrepeat (playerHealth)\n    create clone of (_myself_ v)\n    change x by (50)\nend\nset [heartisclone v] to [0]\nswitch costume to (costume4 v)\ngo to [front v] layer\n\nwhen I receive [scroll v]\nif <(heartIsClone) = [1]> then\n    set y to ((-140) + ((2) * ([cos v] of (((450) * (timer)) - (x position)) )))\n    go to [front v] layer\nelse\n    switch costume to (costume4 v)\n    go to x: (0) y: (-140)\nend\nshow\n\nshow\n\n@Buttons\n\nwhen this sprite clicked\nif <(extrasCloneID) = [1]> then\n    if <(cheatInvincibility) = [1]> then\n        clear graphic effects\n        set [cheatinvincibility v] to [0]\n    else\n        set [brightness v] effect to (20)\n        set [cheatinvincibility v] to [1]\n    end\nelse\n    if <(extrasCloneID) = [2]> then\n        if <(cheatFriendlyFire) = [1]> then\n            clear graphic effects\n            set [cheatfriendlyfire v] to [0]\n        else\n            set [brightness v] effect to (20)\n            set [cheatfriendlyfire v] to [1]\n        end\n    else\n        if <(extrasCloneID) = [3]> then\n            if <(cheatFlight) = [1]> then\n                clear graphic effects\n                set [cheatflight v] to [0]\n                set [availablejumps v] to [0]\n            else\n                set [brightness v] effect to (20)\n                set [cheatflight v] to [1]\n            end\n        else\n            if <(extrasCloneID) = [4]> then\n                set [showanalogstick v] to [-5]\n                broadcast (exitMenu v) and wait\n            else\n                if <<(extrasCloneID) = [extra]> and <(paused) = [0]>> then\n                    set [paused v] to [1]\n                    generateMenu\n                    broadcast (pause v) and wait\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [extrascloneid v] to [extra]\nset [cheatinvincibility v] to [0]\nset [cheatfriendlyfire v] to [0]\nset [cheatflight v] to [0]\nswitch costume to (extras v)\ngo to x: (180) y: (-140)\n\ndefine generateMenu\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (65)\nset [extrascloneid v] to [1]\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\n    change y by (-75)\n    change [extrascloneid v] by (1)\nend\nset [extrascloneid v] to [extra]\ngo to x: (180) y: (-140)\nswitch costume to (extras v)\nshow\n\nwhen I start as a clone\ngo to [front v] layer\nshow\n\nwhen I receive [pause v]\nclear graphic effects\nif <(extrasCloneID) = [1]> then\n    if <(cheatInvincibility) = [1]> then\n        set [brightness v] effect to (20)\n    end\nelse\n    if <(extrasCloneID) = [2]> then\n        if <(cheatFriendlyFire) = [1]> then\n            set [brightness v] effect to (20)\n        end\n    else\n        if <(extrasCloneID) = [3]> then\n            if <(cheatFlight) = [1]> then\n                set [brightness v] effect to (20)\n            end\n        end\n    end\nend\n\nwhen I receive [exitmenu v]\nset [paused v] to [0]\ndelete this clone\n\n@Analog Stick by AzureLightning\n\ndefine drawSling\nif <(drawMode) = [1]> then\n    erase all\n    go to x: (slingXOrigin) y: (slingYOrigin)\n    set pen color to (#424242)\n    pen down\n    go to x: ((xLengthWithinBounds) + (slingXOrigin)) y: ((yLengthWithinBounds) + (slingYOrigin))\nelse\n    go to x: ((xLengthWithinBounds) + (slingXOrigin)) y: ((yLengthWithinBounds) + (slingYOrigin))\n    set pen color to (#cacaca)\n    pen down\nend\n\ndefine calculateLength\nset [xlength v] to ((mouse x) - (slingXOrigin))\nset [ylength v] to ((mouse y) - (slingYOrigin))\nset [lengthofhypotenuse v] to ([sqrt v] of (((xLength) * (xLength)) + ((yLength) * (yLength))) )\nif <(lengthOfHypotenuse) > (slingMaxLength)> then\n    set [hypotenuseratio v] to ((slingMaxLength) / (lengthOfHypotenuse))\n    set [xlengthwithinbounds v] to ((xLength) * (hypotenuseRatio))\n    set [ylengthwithinbounds v] to ((yLength) * (hypotenuseRatio))\nelse\n    set [xlengthwithinbounds v] to (xLength)\n    set [ylengthwithinbounds v] to (yLength)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (origin2 v)\nset [analog is clone v] to [1]\n\nwhen I receive [scroll v]\nif <(showAnalogStick) < [0]> then\n    set [candraw v] to [0]\n    change [showanalogstick v] by (1)\nend\nif <(canDraw) = [1]> then\n    if <(analog is clone) = [1]> then\n        go to x: (slingXOrigin) y: (slingYOrigin)\n        show\n    else\n        go to x: ((xLengthWithinBounds) + (slingXOrigin)) y: ((yLengthWithinBounds) + (slingYOrigin))\n        go to [front v] layer\n        show\n    end\nelse\n    hide\nend\n\nerase all\n\ngo to [front v] layer\n\nwhen flag clicked\nset [analog to x input v] to [0]\nhide\nswitch costume to (stick2 v)\nset [ghost v] effect to (50)\ncreate clone of (_myself_ v)\nset [analog is clone v] to [0]\nset pen size to (5)\npen up\nerase all\nset [slingxorigin v] to [100]\nset [slingyorigin v] to [0]\nset [slingmaxlength v] to [30]\nset [drawmode v] to [1]\nbroadcast (setup v) and wait\nforever\n    set [xlengthwithinbounds v] to [0]\n    set [ylengthwithinbounds v] to [0]\n    if <mouse down?> then\n        if <(holding) = [0]> then\n            set [slingxorigin v] to (mouse x)\n            set [slingyorigin v] to (mouse y)\n            set [candraw v] to [1]\n        end\n        set [holding v] to [1]\n        if <(canDraw) = [1]> then\n            calculateLength\n        end\n    else\n        set [holding v] to [0]\n        set [candraw v] to [0]\n    end\n    set [analog to x input v] to ((xLengthWithinBounds) / (slingMaxLength))\nend\n\nchange [slingxorigin v] by (1)\n\n\n\nwhen flag clicked\nhide\n\nset [candraw v] to [1]\n\n@Sprite1\n\nwhen I receive [start v]\nset [paused v] to [1]\ngo to [front v] layer\nswitch costume to (blank v)\nclear graphic effects\nshow\nset [showanalogstick v] to [-5]\nswitch costume to (blank v)\nwait until <<key (space v) pressed?> or <(canStart) = [1]>>\nset [paused v] to [0]\n\nwhen flag clicked\nset [canstart v] to [0]\nbroadcast (start v)\n\nwhen I receive [scroll v]\nchange [ghost v] effect by (10)\n\nwhen I receive [lose v]\nset [ghost v] effect to (100)\nswitch costume to (blank v)\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [lose v]\ndelete this clone\n\nwhen I receive [win v]\nset [ghost v] effect to (100)\nswitch costume to (blank v)\nset [brightness v] effect to (100)\nset [brightness v] effect to (0)\ngo to [front v] layer\nswitch costume to (the end v)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\nwhen this sprite clicked\nset [canstart v] to [1]\n\nwhen I receive [setup v]\nclear graphic effects\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [scroll v]\ngo to [front v] layer\n\n@Dark\n\nwhen I receive [pause v]\nshow\n\nwhen flag clicked\nset [ghost v] effect to (50)\nhide\n\nwhen I receive [exitmenu v]\nhide\ngo to [front v] layer\ngo [backward v] (4) layers\n\n@Buttons2\n\nwhen flag clicked\ngo to x: (65) y: (138)\n\ndefine generateMenu\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (65)\nset [extrascloneid v] to [1]\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\n    change y by (-75)\n    change [extrascloneid v] by (1)\nend\nset [extrascloneid v] to [extra]\ngo to x: (180) y: (138)\nswitch costume to (extras v)\nshow\n\nwhen I receive [scroll v]\nswitch costume to ((playerCoins) + (1))\n\n@Backup of Background\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: (((groundXPos) * (480)) - ((xScroll) / (7))) y: (() - (yScroll))\nswitch costume to (costume1 v)\nif <(x position) > [480]> then\n    change [groundxpos v] by (-2)\nelse\n    if <(x position) < [-480]> then\n        change [groundxpos v] by (2)\n    end\nend\n\nwhen I receive [setup v]\n\ngo to [back v] layer\nshow\nset [groundxpos v] to [0]\ncreate clone of (_myself_ v)\nset [groundxpos v] to [1]\ncreate clone of (_myself_ v)\nhide\n\n@Backup of Health\n\nwhen I receive [updatehealth v]\n\nbroadcast (deleteHealth v) and wait\ngo to x: (-200) y: (140)\nnoScreenRefresh\n\nwhen I receive [deletehealth v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\n\ndefine noScreenRefresh\nrepeat (playerHealth)\n    create clone of (_myself_ v)\n    change x by (50)\nend\n\nwhen I receive [scroll v]\nset y to ((140) + ((2) * ([cos v] of (((450) * (timer)) - (x position)) )))\n\n@Sprite2\n\n@Trees \n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to ((x) * (480))\nset [groundcostume v] to (costume)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: ((-20) - (yScroll))\nswitch costume to (costume1 v)\n\nwhen I receive [setup v]\nCreate [2] at [0] [100]\nCreate [3] at [4] [100]\n\nwhen I receive [lose v]\ndelete this clone\n\n@vignette\n\nwhen flag clicked\nset [ghost v] effect to (25)\ngo to [front v] layer\n\nwhen I receive [scroll v]\ngo to [front v] layer\ngo [backward v] (12) layers\n\n@Clouds2\n\nwhen I receive [scroll v]\nswitch costume to (costume2 v)\ngo to x: ((19) - ((xScroll) / (1.5))) y: (((1299) + ((3) * ([cos v] of ((150) * (timer)) ))) - ((yScroll) / (1.5)))\nswitch costume to (costume10 v)\ngo to [back v] layer\n\ndefine Create (costume) at (x) (y)\nset [groundxpos v] to ((x) * (480))\nset [groundcostume v] to (costume)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [setup v]\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: ((groundXPos) - (xScroll)) y: (() - (yScroll))\nswitch costume to (groundCostume)\n\nwhen I receive [lose v]\ndelete this clone\n\n