~ Colorless ~  A Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Sunshine v] until done\nend\n\n@Player\n\nwhen flag clicked\nswitch costume to (player v)\nset [purple v] to [0]\nswitch backdrop to (backdrop1 v)\nset [level v] to [1]\nset [x vel v] to [0]\nset [deaths v] to [0]\nset [y vel v] to [0]\nset rotation style [left-right v]\ngo to x: (-205) y: (52)\npoint in direction (90)\nset size to (100) %\ngo to [front v] layer\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n        change [x vel v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        change [x vel v] by (-1)\n    end\n    set [x vel v] to ((X vel) * (0.9))\n    change x by (X vel)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((X vel) * (-1))\n        set [x vel v] to [0]\n    end\n    change [y vel v] by (-1)\n    change y by (Y vel)\n    if <touching (level v)?> then\n        change y by ((Y vel) - ((Y vel) * (2)))\n        set [y vel v] to [0]\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [13]\n        end\n    end\n    if <<(y position) < [-185]> or <<touching (spikes v)?> or <touching (lava v)?>>> then\n        change [deaths v] by (1)\n        broadcast (Restart v)\n    end\n    if <not <(Level) = [20]>> then\n        if <(x position) > [235]> then\n            broadcast (Next Level v)\n            change [level v] by (1)\n            broadcast (Restart v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Purple) = [0]> then\n    switch costume to (trail v)\n    set size to (100) %\n    repeat (10)\n        change [brightness v] effect by (2)\n        change size by (-3)\n        change [ghost v] effect by (9)\n    end\n    delete this clone\nelse\n    switch costume to (trail2 v)\n    set size to (100) %\n    repeat (10)\n        change [brightness v] effect by (2)\n        change size by (-3)\n        change [ghost v] effect by (9)\n    end\n    delete this clone\nend\n\nwhen I receive [restart v]\nset rotation style [left-right v]\ngo to x: (-205) y: (52)\npoint in direction (90)\nset size to (100) %\ngo to [front v] layer\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I receive [purple v]\nset [purple v] to [1]\n\nwhen I receive [purple v]\nswitch costume to (player2 v)\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\n@Level\n\nwhen flag clicked\nswitch costume to (lev 1 v)\nforever\n    switch costume to (Level)\nend\n\n@Moon- Or . . . Sun?\n\nwhen flag clicked\nshow\ngo to [back v] layer\nset size to (100) %\ngo to x: (-124) y: (93)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset size to (100) %\ngo [backward v] (5) layers\nset [ghost v] effect to (40)\ngo to (moon- or . . . sun? v)\nforever\n    go to [back v] layer\n    go [backward v] (10) layers\n    repeat (70)\n        change size by (0.1)\n    end\n    repeat (70)\n        change size by (-0.1)\n    end\nend\n\n@Magic Brush\n\nwhen flag clicked\nrepeat (2)\n    hide\n    clear graphic effects\nend\nwait until <(Level) = [5]>\nrepeat (2)\n    switch costume to (green v)\n    go to x: (187) y: (-41)\n    show\nend\nwait until <(Level) = [6]>\nrepeat (10)\n    hide\nend\nwait until <(Level) = [8]>\nrepeat (2)\n    clear graphic effects\n    switch costume to (brown v)\n    go to x: (200) y: (-41)\n    show\nend\nwait until <(Level) = [9]>\nrepeat (10)\n    hide\nend\nwait until <(Level) = [12]>\nrepeat (2)\n    clear graphic effects\n    show\n    switch costume to (red v)\n    go to x: (119) y: (-41)\nend\nwait until <(Level) = [11]>\nrepeat (10)\n    hide\nend\nwait until <(Level) = [16]>\nrepeat (2)\n    clear graphic effects\n    show\n    switch costume to (blue v)\n    go to x: (100) y: (100)\nend\nswitch backdrop to (backdrop1 v)\nwait until <touching (player v)?>\nswitch backdrop to (backdrop2 v)\nwait until <(Level) = [19]>\nrepeat (2)\n    clear graphic effects\n    show\n    switch costume to (purple v)\n    go to x: (136) y: (-46)\nend\nwait until <touching (player v)?>\nbroadcast (Purple v)\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        repeat (10)\n            change y by (1)\n            change [brightness v] effect by (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (9) layers\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Lava\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    glide (1) secs to x: (x position) y: ((y position) + (10))\n    glide (1) secs to x: (x position) y: ((y position) - (10))\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (140)\nshow\nswitch costume to (text 1 v)\nset size to (150) %\nclear graphic effects\nshow\nset [ghost v] effect to (0)\nrepeat (7)\n    wait until <key (space v) pressed?>\n    if <(Level) = [1]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        next costume\n        if <not <(costume [number v]) = [8]>> then\n            repeat (10)\n                change [ghost v] effect by (-10)\n            end\n        else\n            switch costume to (text 7 v)\n            clear graphic effects\n        end\n    end\nend\n\nwhen flag clicked\nrepeat (2)\n    show\nend\nwait until <([costume # v] of [level v]) > [1]>\nhide\nswitch costume to (text 9 v)\nwait until <([costume # v] of [level v]) = [5]>\nrepeat (2)\n    switch costume to (text 9 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [6]>\nrepeat (2)\n    hide\nend\nwait until <([costume # v] of [level v]) = [12]>\nrepeat (2)\n    switch costume to (text 11 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [13]>\nrepeat (2)\n    switch costume to (text 12 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [14]>\nrepeat (2)\n    switch costume to (text 13 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [15]>\nrepeat (2)\n    switch costume to (text 14 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [16]>\nrepeat (2)\n    switch costume to (text 15 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [17]>\nrepeat (2)\n    switch costume to (text 10 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [18]>\nrepeat (2)\n    switch costume to (text 16 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [19]>\nrepeat (2)\n    switch costume to (text 17 v)\n    show\nend\nwait until <([costume # v] of [level v]) = [20]>\nrepeat (2)\n    switch costume to (text 18 v)\n    show\nend\n\n@Sprite2\n\nset [ghost v] effect to (20)\n\nwhen flag clicked\ngo to x: (187) y: (-150)\npoint in direction (90)\nset size to (100) %\nforever\n    if <(Deaths) > [2]> then\n        show\n        if <touching (mouse-pointer v)?> then\n            set size to ((size) + (((120) - (size)) / (5))) %\n            set [ghost v] effect to (30)\n            if <mouse down?> then\n                if <(Level) = [16]> then\n                    switch backdrop to (backdrop2 v)\n                end\n                if <(Level) = [19]> then\n                    broadcast (Purple v)\n                end\n                change [level v] by (1)\n                broadcast (Restart v)\n                set [deaths v] to [0]\n            end\n        else\n            clear graphic effects\n            set size to ((size) + (((100) - (size)) / (5))) %\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [next level v]\nset [deaths v] to [0]\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (1000)\n    change [ghost v] effect by (1000)\n    go to [front v] layer\n    go [forward v] (1000) layers\nend\n\n