Rainbow! A Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Sprite1\n\nwhen I start as a clone\nforever\n    repeat (16)\n        change [color v] effect by (10)\n        change [ghost v] effect by (6.25)\n        if <(x position) > [270]> then\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\nstart sound [Electric by bubblebee3 v]\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (-86) y: (-128)\n\nwhen backdrop switches to [backdrop3 v]\ngo to x: (-91) y: (-185)\n\nwhen backdrop switches to [backdrop3 v]\ngo to x: (-93) y: (-168)\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (-108) y: (-170)\n\nwhen backdrop switches to [backdrop5 v]\ngo to x: (-104) y: (-146)\n\nwhen backdrop switches to [backdrop6 v]\ngo to x: (-126) y: (-143)\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-113) y: (-144)\n\nwhen backdrop switches to [backdrop8 v]\ngo to x: (-118) y: (-150)\n\nwhen backdrop switches to [backdrop9 v]\ngo to x: (-115) y: (-160)\n\nwhen backdrop switches to [backdrop10 v]\ngo to x: (-148) y: (-164)\n\nwhen backdrop switches to [backdrop11 v]\ngo to x: (-116) y: (-139)\n\nwhen I receive [game start! v]\nforever\n    if <key (s v) pressed?> then\n        wait (.5) seconds\n        switch backdrop to (next backdrop v)\n    end\n    if <(backdrop [number v]) = [11]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [game start! v]\nshow\nset [deaths v] to [0]\nswitch costume to (costume1 v)\nshow\ngo to x: (-94) y: (-128)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume v)\n        change [x v] by (0.5)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-0.5)\n        switch costume to (costume v)\n    end\n    change x by (X)\n    set [x v] to ((X) * (0.9))\n    if <touching color (#18ff4d)?> then\n        change y by (0.5)\n        if <touching color (#18ff4d)?> then\n            change y by (0.5)\n            if <touching color (#18ff4d)?> then\n                change y by (0.5)\n                if <touching color (#18ff4d)?> then\n                    change y by (0.5)\n                    if <touching color (#18ff4d)?> then\n                        change y by (0.5)\n                        if <touching color (#18ff4d)?> then\n                            change y by (0.5)\n                            if <touching color (#18ff4d)?> then\n                                change y by (0.5)\n                                if <touching color (#18ff4d)?> then\n                                    change y by (0.5)\n                                    if <key (up arrow v) pressed?> then\n                                        if <[0] < (X)> then\n                                            set [x v] to [-7]\n                                        else\n                                            set [x v] to [7]\n                                        end\n                                        set [y v] to [10]\n                                    else\n                                        set [x v] to ((X) * (-1.3))\n                                        change x by (X)\n                                        set [x v] to [0]\n                                        change x by ((X) / (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 [y v] by (-0.5)\n    change y by (Y)\n    if <touching color (#18ff4d)?> then\n        set [y v] to ((Y) * (-0.25))\n        change y by (Y)\n        if <touching color (#18ff4d)?> then\n            change y by (Y)\n            if <touching color (#18ff4d)?> then\n                change y by (Y)\n                if <touching color (#18ff4d)?> then\n                    change y by (Y)\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<key (up arrow v) pressed?> and <touching color (#18ff4d)?>> then\n        set [y v] to [10]\n        switch costume to (costume v)\n    end\n    change y by (1)\n    if <touching (sprite6 v)?> then\n        switch costume to (costume1 v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-180) y: (-127)\n        set [ghost v] effect to (0)\n        switch costume to (costume v)\n    end\n    if <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> then\n        change [x v] by (0.5)\n    end\n    if <(x position) > [270]> then\n        switch backdrop to (next backdrop v)\n    end\n    if <<touching (sprite9 v)?> or <<<touching (sprite8 v)?> or <touching (sprite7 v)?>> or <<touching (sprite6 v)?> or <<touching (sprite5 v)?> or <<touching (sprite4 v)?> or <touching (sprite3 v)?>>>>>> then\n        change [deaths v] by (1)\n        go to x: (-135) y: (-185)\n    end\n    if <(y position) < [-230]> then\n        change [deaths v] by (1)\n        go to x: (-131) y: (-159)\n    end\nend\n\nwhen I receive [game start! v]\nforever\n    create clone of (_myself_ v)\n    if <key (x v) pressed?> then\n        broadcast (Toggle v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [game start! v]\nforever\n    play sound [Electric by bubblebee3 v] until done\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [toggle v]\nwait (1) seconds\nforever\n    if <key (z v) pressed?> then\n        broadcast (Toggle 2 v)\n    end\nend\n\nwhen I receive [toggle 2 v]\nforever\n    create clone of (_myself_ v)\n    if <key (x v) pressed?> then\n        broadcast (Toggle 3 v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [toggle 3 v]\nforever\n    if <key (z v) pressed?> then\n        broadcast (Toggle 4 v)\n    end\nend\n\nwhen I receive [toggle 4 v]\nforever\n    create clone of (_myself_ v)\n    if <key (z v) pressed?> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [toggle 4 v]\nforever\n    create clone of (_myself_ v)\n    if <key (x v) pressed?> then\n        broadcast (Toggle 5 v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [toggle 5 v]\nforever\n    if <key (z v) pressed?> then\n        create clone of (_myself_ v)\n        broadcast (Toggle 6 v)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop2 v]\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [backdrop3 v]\nswitch costume to (costume3 v)\n\nwhen backdrop switches to [backdrop4 v]\nswitch costume to (costume4 v)\n\nwhen backdrop switches to [backdrop5 v]\nswitch costume to (costume5 v)\n\nwhen backdrop switches to [backdrop6 v]\nswitch costume to (costume6 v)\n\nwhen backdrop switches to [backdrop7 v]\nswitch costume to (costume7 v)\n\nwhen backdrop switches to [backdrop8 v]\nswitch costume to (costume8 v)\n\nwhen backdrop switches to [backdrop9 v]\nswitch costume to (costume9 v)\n\nwhen backdrop switches to [backdrop10 v]\nswitch costume to (costume10 v)\n\nwhen backdrop switches to [backdrop11 v]\nswitch costume to (costume11 v)\n\nwhen I receive [game start! v]\nshow\ngo to x: (32) y: (-7)\nswitch costume to (costume1 v)\n\n@Sprite3\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset size to (100) %\nhide\n\nwhen backdrop switches to [backdrop2 v]\nshow\ngo to x: (10) y: (-121)\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (10) y: (-120)\nshow\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (-83) y: (-123)\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-131) y: (-121)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\nwhen backdrop switches to [backdrop9 v]\nswitch costume to (costume2 v)\nshow\ngo to x: (65) y: (-119)\n\nwhen backdrop switches to [backdrop10 v]\nhide\n\n@Sprite4\n\nwhen flag clicked\nset size to (100) %\nhide\n\nwhen backdrop switches to [backdrop2 v]\nshow\ngo to x: (84) y: (-120)\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (85) y: (-121)\nshow\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\nwhen backdrop switches to [backdrop7 v]\nshow\ngo to x: (55) y: (-121)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\nwhen backdrop switches to [backdrop9 v]\nshow\ngo to x: (-51) y: (-120)\n\nwhen backdrop switches to [backdrop10 v]\nhide\n\n@Sprite5\n\nwhen flag clicked\nset size to (100) %\nhide\n\nwhen backdrop switches to [backdrop4 v]\nshow\ngo to x: (121) y: (-122)\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-18) y: (-121)\nshow\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (53) y: (-124)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\n@Sprite6\n\nwhen flag clicked\nswitch costume to (costume2 v)\nset size to (100) %\nhide\n\nwhen backdrop switches to [backdrop4 v]\nshow\ngo to x: (-65) y: (-120)\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\nhide\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (170) y: (-123)\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (203) y: (-122)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\nwhen backdrop switches to [backdrop9 v]\nswitch costume to (costume1 v)\nshow\ngo to x: (-129) y: (-3)\n\nwhen backdrop switches to [backdrop10 v]\nhide\n\n@Sprite7\n\nwhen flag clicked\nset size to (45) %\nhide\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (-24) y: (-58)\n\nwhen backdrop switches to [backdrop6 v]\nhide\n\n@Sprite8\n\nwhen flag clicked\nset size to (45) %\nhide\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (-23) y: (19)\n\nwhen backdrop switches to [backdrop6 v]\nhide\n\n@Sprite9\n\nwhen flag clicked\nswitch costume to (costume2 v)\nset size to (100) %\nhide\n\nwhen backdrop switches to [backdrop7 v]\nshow\ngo to x: (87) y: (-121)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\nwhen backdrop switches to [backdrop9 v]\ngo to x: (29) y: (-6)\nshow\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [backdrop10 v]\nhide\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop2 v]\nhide\n\nwhen backdrop switches to [backdrop11 v]\nshow\nswitch costume to (costume2 v)\n\nwhen I receive [game start! v]\nshow\nswitch costume to (costume1 v)\n\n@Sprite11\n\nwhen flag clicked\nshow\nwait (1.3) seconds\nrepeat (25)\n    change [ghost v] effect by (4)\nend\n\nwhen I receive [game start! v]\nhide\n\nwhen flag clicked\nwait (2) seconds\nbroadcast (Game Start! v)\n\n@download (6)\n\nwhen I receive [game start! v]\nshow\nStart\nforever\n    wait (.5) seconds\n    hide\n    point in direction (pick random (-70) to (-100))\n    go to x: (300) y: (pick random (-180) to (180))\n    set size to (pick random (20) to (50)) %\n    set [ghost v] effect to (pick random (55) to (75))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to [back v] layer\nrepeat until <(x position) < [-220]>\n    move (5) steps\nend\ndelete this clone\n\nhide\n\ndefine Start\n\n
Arrow keys to move and jump\nAvoid spikes and falling\nGet to the end of the screen to advance!\nS to skip a level\nPress X to turn the trail off (reduces lag) and Z to turn it back on \n