Colors: A Platformer

Instructions:  -ˏˋ Colors: A Platformer ˊˎ-\n\nNow mobile friendly!\nArrow keys or WASD to move on a pc, drag your finger on mobile.\n"R" to restart level, "S" to skip level, "B" to go back one level.\nThere are 24 levels; all are possible. There's no time, limited lives, or deaths count, so just have fun!\nThanks to @carot800 for the platformer engine!\n\nPlatforms are white.\nTrampolines are blue.\nPortals are pink.\nYellow is sticky.\nRed is danger.\nYou are a cute little green sphere. \nGood luck!\n\nHuge thanks to @-Potaton- for the intro! (Go follow them, they're super underrated!)\n\nMusic from purple-planet.com, "Get Happy"\nPress M to mute.\n#Games #Platformer #Colors\n@IcedSnow loved!! :0

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop3 v)\n\nwhen flag clicked\nset [start? v] to [no]\nrepeat until <(Start?) = [yes]>\n    set [level # v] to [1]\nend\n\nwhen I receive [start v]\nset [start? v] to [yes]\n\nwhen I receive [start v]\nwait (.5) seconds\nforever\n    play sound [Purple Planet Music - Get Happy \(1_36\) 150bpm v] until done\nend\n\nwhen flag clicked\nset [mute? v] to [0]\nforever\n    if <((Mute?) mod (2)) = [0]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen [m v] key pressed\nchange [mute? v] by (1)\n\nswitch costume to (costume3 v)\nswitch costume to (backdrop3 v)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch backdrop to (Level #)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    switch backdrop to (Level #)\nend\n\n@player\n\nwhen flag clicked\n\nwhen I receive [go to v]\ngo to x: (-155) y: (-130)\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen [r v] key pressed\nbroadcast (go to v)\nchange [level # v] by (-1)\nchange [level # v] by (1)\nwait until <not <key (r v) pressed?>>\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    if <key (b v) pressed?> then\n        broadcast (go to v)\n        change [level # v] by (-1)\n        wait until <not <key (b v) pressed?>>\n    end\nend\n\nwhen flag clicked\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <key (s v) pressed?> then\n        broadcast (go to v)\n        change [level # v] by (1)\n        wait until <not <key (s v) pressed?>>\n    end\nend\n\nwhen I receive [start v]\nwait (.01) seconds\nforever\n    if <<touching color (#00fffd)?> or <touching color (#00ffbf)?>> then\n        repeat until <<<<(Yv) < [1]> or <<touching color (#ff0000)?> or <touching color (#ff00d8)?>>> or <key (b v) pressed?>> or <<key (r v) pressed?> or <key (s v) pressed?>>>\n            say [Wheee!!!] for (.0000000001) seconds\n        end\n    end\nend\n\nwhen I receive [start v]\nwait (.01) seconds\nforever\n    if <touching color (#00fffd)?> then\n        set [yv v] to [13]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <touching color (#ff0000)?> then\n        broadcast (go to v)\n    end\nend\n\nwhen I receive [start v]\nwait (.01) seconds\nforever\n    if <touching color (#00ffbf)?> then\n        set [yv v] to [16]\n    end\nend\n\nwhen I receive [start v]\nwait (1) seconds\nswitch costume to (right v)\nbroadcast (go to v)\nshow\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        switch costume to (right v)\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n        switch costume to (left v)\n        change [xv v] by (-1)\n    end\n    change x by (Xv)\n    set [xv v] to ((Xv) * (0.9))\n    if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n        change y by (.5)\n        if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n            change y by (.5)\n            if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                change y by (.5)\n                if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                    change y by (.5)\n                    if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                        change y by (.5)\n                        if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                            change y by (.5)\n                            if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                                change y by (.5)\n                                if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                                    change y by (.5)\n                                    if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> and <not <touching color (#efff00)?>>> then\n                                        if <(Xv) > [0]> then\n                                            set [xv v] to [-7]\n                                        else\n                                            set [xv v] to [7]\n                                        end\n                                        set [yv v] to [10]\n                                    else\n                                        set [xv v] to ((Xv) * (-1.3))\n                                        change x by (Xv)\n                                        set [xv v] to [0]\n                                        change x by ((Xv) / (5))\n                                    end\n                                    change y by (-4)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-0.5)\n    change y by (Yv)\n    if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n        set [yv v] to ((Yv) * (-0.25))\n        change y by (Yv)\n        if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n            change y by (Yv)\n            if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                change y by (Yv)\n                if <<touching color (#ffffff)?> or <touching color (#efff00)?>> then\n                    change y by (Yv)\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<not <touching color (#fbff00)?>> and <<touching color (#ffffff)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>>> then\n        set [yv v] to [8.6]\n    end\n    change y by (1)\nend\n\nwhen I receive [start v]\nset [level # v] to [1]\nforever\n    if <touching color (#ff00d8)?> then\n        broadcast (go to v)\n        change [level # v] by (1)\n        wait until <not <touching color (#ff00d8)?>>\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@Intro\n\nwhen flag clicked\nset size to (100) %\nset volume to (100) %\nstart sound [yt1s v]\npoint in direction (90)\nset [my variable v] to [0]\nswitch costume to (p2 v)\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nrepeat (6)\n    change [my variable v] by (1)\n    create clone of (_myself_ v)\nend\nwait (2) seconds\nhide\nwait (6) seconds\nrepeat (100)\n    change volume by (-1)\nend\nbroadcast (Start v)\n\nwhen I start as a clone\nhide\nset size to (50) %\nif <(my variable) = [6]> then\n    show\n    set size to (100) %\n    go to x: (0) y: (0)\n    go to [back v] layer\n    switch costume to (costume4 v)\n    wait (6.36) seconds\n    go to [front v] layer\n    go [backward v] (2) layers\n    switch costume to (costume4 v)\n    repeat (26)\n        change x by ((() - ([abs v] of ((x position) - (5)) )) / (5))\n    end\n    hide\nend\nif <(my variable) = [5]> then\n    go to x: (0) y: (-80)\n    hide\n    switch costume to (costume3 v)\n    wait (1.5) seconds\n    show\n    go to [back v] layer\n    go [forward v] (1) layers\n    wait ((1) + (.5)) seconds\n    repeat until <(y position) > [-1]>\n        change y by (((0) - (y position)) * (.1))\n    end\n    wait (.5) seconds\n    repeat until <(y position) > [24]>\n        change y by (((35) - (y position)) * (.1))\n    end\nend\nif <(my variable) = [4]> then\n    hide\n    switch costume to (costume2 v)\n    wait (1.5) seconds\n    show\n    go to [front v] layer\n    wait (4) seconds\nend\nif <(my variable) = [3]> then\n    show\n    go to [back v] layer\n    switch costume to (costume1 v)\n    go to x: (-140) y: (0)\n    wait (1.5) seconds\n    repeat until <(x position) > [-1]>\n        go to x: ((x position) * (.85)) y: (0)\n    end\n    wait (.5) seconds\n    repeat until <(y position) > [27]>\n        change y by (((30) - (y position)) * (.1))\n    end\nend\nif <(my variable) = [2]> then\n    show\n    go to [front v] layer\n    switch costume to (p v)\n    wait (1) seconds\n    repeat until <(x position) < [-79]>\n        go to x: ((x position) + (((-80) - (x position)) * (.2))) y: (0)\n    end\n    go to [front v] layer\n    wait (4) seconds\n    repeat until <(x position) > [195]>\n        go to x: ((x position) + (((197) - (x position)) * (.2))) y: (0)\n    end\n    repeat (26)\n        change x by ((() - ([abs v] of ((x position) - (200)) )) / (5))\n    end\nend\nif <(my variable) = [1]> then\n    show\n    go to [front v] layer\n    switch costume to (costume4 v)\n    set size to (100) %\n    wait (1) seconds\nend\ndelete this clone\n\n