Grayscale Superstorm - A Platformer

Instructions: Use [W] [A] [D] or arrow keys to move.\nAvoid the spikes and try to get to the right side of the screen.\nLove and favorite this project to unlock the ability to change the player's color, then press [C] to change color.\nPress [R] to reset your position in case you get stuck.\nBeat the game quickly to get the high score.*\nHave fun! :)\n\n*You must have full scratcher status in order for your highscore to appear.

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    if <<(Effect) = [1]> or <(Effect) = [4]>> then\n        switch backdrop to (backdrop1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Effect) = [3]> then\n        switch backdrop to (backdrop3 v)\n        wait (0.3) seconds\n        repeat (3)\n            change [brightness v] effect by (-5)\n        end\n        repeat (3)\n            change [brightness v] effect by (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Effect) = [2]> then\n        broadcast (Bg1 v)\n        change [brightness v] effect by (25)\n        wait (0.1) seconds\n        change [brightness v] effect by (25)\n        wait (0.1) seconds\n        change [brightness v] effect by (-25)\n        wait (0.1) seconds\n        change [brightness v] effect by (-25)\n        wait (5) seconds\n        broadcast (Bg2 v)\n        change [brightness v] effect by (25)\n        wait (0.1) seconds\n        change [brightness v] effect by (25)\n        wait (0.1) seconds\n        change [brightness v] effect by (-25)\n        wait (0.1) seconds\n        change [brightness v] effect by (-25)\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Effect) = [5]> then\n        switch backdrop to (backdrop1 v)\n        wait (0.2) seconds\n        repeat (3)\n            change [brightness v] effect by (8)\n        end\n        repeat (6)\n            change [brightness v] effect by (-4)\n        end\n    end\nend\n\nwhen flag clicked\nset [effect v] to [1]\nwait (1) seconds\nforever\n    if <<(slide) > [4]> and <(slide) < [8]>> then\n        set [effect v] to [2]\n    end\n    if <<(slide) > [8]> and <(slide) < [12]>> then\n        set [effect v] to [3]\n    end\n    if <<(slide) > [12]> and <(slide) < [16]>> then\n        set [effect v] to [4]\n    end\n    if <(slide) > [16]> then\n        set [effect v] to [5]\n    end\nend\n\n@Cube\n\nwhen flag clicked\nset volume to (100) %\ngo to x: (-185) y: (-30)\nset rotation style [left-right v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nswitch costume to (cube v)\ngo to [back v] layer\nclear graphic effects\ngo [forward v] (8) layers\nset size to (48) %\nshow\nforever\n    if <<key (r v) pressed?> or <<touching (spikes v)?> or <<touching (_edge_ v)?> and <(y position) < [-178]>>>> then\n        switch costume to (die v)\n        repeat (5)\n            change [ghost v] effect by (20)\n            change size by (10)\n            wait (0.01) seconds\n        end\n        go to x: (-200) y: (-30)\n        set size to (48) %\n        switch costume to (cube v)\n        set [ghost v] effect to (0)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (_edge_ v)?> and <[230] < (x position)>> then\n        if <(slide) = [20]> then\n            hide\n            broadcast (Game Win v)\n            stop [this script v]\n        else\n            go to x: (-200) y: (-30)\n            set [x velocity v] to [0]\n            set [y velocity v] to [0]\n            broadcast (Next Slide v)\n            wait until <not <touching (_edge_ v)?>>\n        end\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > ((x position) + (10))> and <mouse down?>>> then\n        point in direction (90)\n        set [direction v] to [1]\n        change [x velocity v] by (3.3)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < ((x position) - (10))> and <mouse down?>>> then\n        point in direction (-90)\n        set [direction v] to [0]\n        change [x velocity v] by (-3.3)\n    end\n    set [x velocity v] to ((x velocity) * (0.67))\n    change x by (x velocity)\n    if <touching (platforms v)?> then\n        change y by (-2)\n        if <touching (platforms v)?> then\n            change y by (1)\n            if <touching (platforms v)?> then\n                change y by (1)\n                if <touching (platforms v)?> then\n                    change y by (1)\n                    if <touching (platforms v)?> then\n                        change y by (1)\n                        if <touching (platforms v)?> then\n                            change y by (1)\n                            if <touching (platforms v)?> then\n                                change y by (-5)\n                                change x by ((-1) * (x velocity))\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <touching (platforms v)?> then\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> or <<(mouse y) > ((y position) + (20))> and <mouse down?>>> then\n            set [y velocity v] to [12.3]\n        end\n    end\n    change y by (3)\n    if <(y velocity) > [-15]> then\n        change [y velocity v] by (-1)\n    end\n    change y by (-2)\n    if <not <touching (platforms v)?>> then\n        change y by (-1)\n        if <not <touching (platforms v)?>> then\n            change y by (-1)\n            if <not <touching (platforms v)?>> then\n                change y by (-1)\n                if <not <touching (platforms v)?>> then\n                    change y by (-1)\n                    if <not <touching (platforms v)?>> then\n                        change y by (-1)\n                        if <not <touching (platforms v)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (y velocity)\n    if <touching (platforms v)?> then\n        change y by (-2)\n        if <touching (platforms v)?> then\n            change y by ((-1) * (y velocity))\n            set [y velocity v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Creo - Dimension v] until done\nend\n\nwhen flag clicked\nforever\n    if <key (c v) pressed?> then\n        if <<(heart) = [1]> and <(star) = [1]>> then\n            change [color v] effect by (2)\n        else\n            if <(message) = [0]> then\n                create clone of (message v)\n            end\n            wait until <not <key (c v) pressed?>>\n        end\n    end\nend\n\nwhen [m v] key pressed\nif <(volume) = [0]> then\n    set volume to (100) %\nelse\n    set volume to (0) %\nend\n\n@Dust Effect 1\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (9) layers\nhide\nrepeat (2)\n    do the thingy\n    wait (0.5) seconds\n    Do the other thingy\n    wait (0.5) seconds\nend\ndo the thingy\n\nif <(Effect) = [1]> then\nend\n\nwhen I start as a clone\nshow\nset y to (180)\nrepeat until <not <touching (_edge_ v)?>>\n    change y by (-4)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (-4)\nend\nif <(Effect) = [1]> then\n    create clone of (_myself_ v)\nend\ndelete this clone\n\ndefine do the thingy\ngo to x: (-200) y: (180)\nrepeat (6)\n    create clone of (_myself_ v)\n    change x by (80)\nend\n\ndefine Do the other thingy\ngo to x: (-160) y: (180)\nrepeat (5)\n    create clone of (_myself_ v)\n    change x by (80)\nend\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [1]>> then\n        delete this clone\n    end\nend\n\n@Line Effect 1\n\nwhen flag clicked\nset [ghost v] effect to (50)\nhide\nforever\n    if <(Effect) = [2]> then\n        wait (pick random (0.5) to (3)) seconds\n        show\n        go to x: (0) y: (200)\n        glide (4) secs to x: (0) y: (-200)\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Effect) = [2]>> then\n        hide\n    end\nend\n\n@Line Effect 2\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (11) layers\nhide\nforever\n    if <(Effect) = [2]> then\n        wait (2) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (30)\ngo to x: (300) y: (pick random (180) to (-180))\nshow\nglide (3) secs to x: (-300) y: (y position)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [2]>> then\n        delete this clone\n    end\nend\n\n@Background Effect 1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nset size to (130) %\nswitch costume to (costume2 v)\nset [ghost v] effect to (90)\ngo to [back v] layer\nforever\n    if <(Effect) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [bg1 v]\nrepeat (6)\n    change [ghost v] effect by (-10)\n    wait (0.1) seconds\nend\n\nwhen I receive [bg2 v]\nrepeat (6)\n    change [ghost v] effect by (10)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nforever\n    glide (0.75) secs to x: (-30) y: (0)\n    glide (0.75) secs to x: (-20) y: (-20)\n    glide (0.75) secs to x: (0) y: (-30)\n    glide (0.75) secs to x: (20) y: (-20)\n    glide (0.75) secs to x: (30) y: (0)\n    glide (0.75) secs to x: (20) y: (20)\n    glide (0.75) secs to x: (0) y: (30)\n    glide (0.75) secs to x: (-20) y: (20)\nend\n\n@Background Effect 2\n\nwhen I receive [bg1 v]\nrepeat (6)\n    change [ghost v] effect by (5)\n    wait (0.1) seconds\nend\n\nwhen I receive [bg2 v]\nrepeat (6)\n    change [ghost v] effect by (-5)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (30)\nforever\n    if <(Effect) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    glide (0.75) secs to x: (30) y: (0)\n    glide (0.75) secs to x: (20) y: (20)\n    glide (0.75) secs to x: (0) y: (30)\n    glide (0.75) secs to x: (-20) y: (20)\n    glide (0.75) secs to x: (-30) y: (0)\n    glide (0.75) secs to x: (-20) y: (-20)\n    glide (0.75) secs to x: (0) y: (-30)\n    glide (0.75) secs to x: (20) y: (-20)\nend\n\n@Dust Effect 2\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (10) layers\nhide\nforever\n    if <(Effect) = [2]> then\n        wait (0.3) seconds\n        create clone of (_myself_ v)\n    end\n    if <(Effect) = [1]> then\n        wait (pick random (0.1) to (0.3)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nif <(Effect) = [2]> then\n    go to x: (240) y: (pick random (180) to (-180))\n    clear graphic effects\n    show\n    glide (2) secs to x: (-240) y: (y position)\n    delete this clone\nend\nif <(Effect) = [1]> then\n    go to x: (240) y: (pick random (-10) to (-90))\n    set [ghost v] effect to (85)\n    show\n    glide (4) secs to x: (-240) y: (y position)\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <<not <(Effect) = [1]>> and <not <(Effect) = [2]>>> then\n        delete this clone\n    end\nend\n\n@Background Effect 3N\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(Effect) = [3]> then\n        switch costume to (costume1 v)\n        show\n    else\n        if <(Effect) = [4]> then\n            switch costume to (costume2 v)\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Particle Effect 1\n\nwhen flag clicked\nhide\nforever\n    if <<(Effect) = [3]> or <(Effect) = [4]>> then\n        Create Clones\n    end\nend\n\nwhen I start as a clone\nshow\ngo to (random position v)\nwait (0.03) seconds\ndelete this clone\n\ndefine Create Clones\nrepeat (20)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nforever\n    if <<not <(Effect) = [4]>> and <not <(Effect) = [3]>>> then\n        delete this clone\n    end\nend\n\n@Tornado\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\nforever\n    if <(Effect) = [3]> then\n        show\n        glide (0.2) secs to x: ((x position) + ((15) * (Direction))) y: ((y position) + (131))\n        change y by (-131)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Direction) = [-1]> then\n        set [direction v] to [1]\n    else\n        set [direction v] to [-1]\n    end\n    wait (pick random (3) to (4)) seconds\nend\n\n@Lights\n\nwhen flag clicked\nhide\nforever\n    if <(Effect) = [4]> then\n        Create Clones\n    end\nend\n\ndefine Create Clones\nset [clone chance v] to (pick random (1) to (100))\nif <<[25] < (clone chance)> and <[100] > (clone chance)>> then\n    create clone of (_myself_ v)\nend\nturn right (25) degrees\nwait (0.01) seconds\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (50) to (65))\nshow\nrepeat (5)\n    turn right (2) degrees\n    change [ghost v] effect by (-2)\nend\nrepeat (15)\n    turn right (2) degrees\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [4]>> then\n        delete this clone\n    end\nend\n\n@Wheel Effect\n\nwhen flag clicked\ngo to [back v] layer\nset [position v] to [1]\nset size to (90) %\ngo to x: (-1) y: (25)\nset [ghost v] effect to (50)\nrepeat (2)\n    create clone of (_myself_ v)\n    change [position v] by (1)\nend\nforever\n    if <(Effect) = [4]> then\n        show\n        turn right (2) degrees\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nif <(position) = [1]> then\n    go to x: (-188.7) y: (-41)\nelse\n    go to x: (199) y: (-36)\nend\nset size to (60) %\nset [ghost v] effect to (50)\nforever\n    if <(Effect) = [4]> then\n        show\n        turn right (2) degrees\n    else\n        hide\n    end\nend\n\n@Flash Effect\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <(Effect) = [4]> then\n        show\n        wait (0.3) seconds\n        repeat (3)\n            change [ghost v] effect by (-15)\n        end\n        repeat (3)\n            change [ghost v] effect by (15)\n        end\n    else\n        hide\n    end\nend\n\n@Particle Effect 2\n\nwhen flag clicked\nhide\nset [ghost v] effect to (30)\nforever\n    if <(Effect) = [4]> then\n        create clone of (_myself_ v)\n        wait (pick random (0.8) to (1)) seconds\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nset [i v] to (pick random (0) to (1))\nif <(i) = [1]> then\n    go to x: (pick random (240) to (-190)) y: (180)\nelse\n    go to x: (240) y: (pick random (180) to (-100))\nend\nturn right (pick random (1) to (360)) degrees\nset size to (40) %\nshow\nrepeat until <not <touching (_edge_ v)?>>\n    change y by (-2)\n    change x by (-2)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (-2)\n    change x by (-2)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [4]>> then\n        delete this clone\n    end\nend\n\n@Lines\n\nwhen flag clicked\ngo to x: (0) y: (-50)\ngo to [back v] layer\nset [ghost v] effect to (25)\ngo [forward v] (8) layers\nforever\n    glide (3) secs to x: (0) y: (51)\n    glide (3) secs to x: (0) y: (-51)\nend\n\nwhen flag clicked\nforever\n    if <(Effect) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\n@Particle Effect 3\n\nwhen flag clicked\nhide\nforever\n    if <(Effect) = [5]> then\n        create clone of (_myself_ v)\n        wait (0.01) seconds\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nset [i v] to (pick random (0) to (1))\nif <(i) = [1]> then\n    go to x: (pick random (240) to (-190)) y: (180)\nelse\n    go to x: (240) y: (pick random (180) to (-100))\nend\nturn right (pick random (1) to (360)) degrees\nset size to (pick random (40) to (120)) %\nshow\nrepeat until <not <touching (_edge_ v)?>>\n    change y by (-3)\n    change x by (-3)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (-3)\n    change x by (-3)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [5]>> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <(Effect) = [5]>> then\n        delete this clone\n    end\nend\n\n@Wave Effect\n\nwhen flag clicked\nhide\ngo to [back v] layer\ngo to x: (-210) y: (0)\nrepeat (8)\n    create clone of (_myself_ v)\n    wait (0.5) seconds\n    change x by (60)\nend\n\nwhen I start as a clone\nset y to (-50)\nshow\nforever\n    glide (2) secs to x: (x position) y: (40)\n    glide (0.5) secs to x: (x position) y: (50)\n    glide (2) secs to x: (x position) y: (-40)\n    glide (0.5) secs to x: (x position) y: (-50)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nforever\n    repeat (10)\n        change [ghost v] effect by (6)\n        wait (0.1) seconds\n    end\n    wait (0.4) seconds\n    repeat (10)\n        change [ghost v] effect by (-6)\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Effect) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\n@Platforms\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [slide v] to [1]\nswitch costume to (costume1 v)\ngo to [back v] layer\ngo [forward v] (7) layers\nforever\n    if <(Effect) = [3]> then\n        wait (0.3) seconds\n        repeat (3)\n            change [brightness v] effect by (20)\n        end\n        repeat (3)\n            change [brightness v] effect by (-20)\n        end\n    end\n    clear graphic effects\nend\n\nwhen I receive [next slide v]\nchange [slide v] by (1)\nnext costume\n\n@Spikes\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [back v] layer\ngo [forward v] (6) layers\nforever\n    if <(Effect) = [3]> then\n        wait (0.3) seconds\n        repeat (3)\n            change [brightness v] effect by (20)\n        end\n        repeat (3)\n            change [brightness v] effect by (-20)\n        end\n    end\n    clear graphic effects\nend\n\nwhen I receive [next slide v]\nnext costume\n\nset [effect v] to [3]\nset [slide v] to [9]\n\n@Deco\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [back v] layer\ngo [forward v] (5) layers\nforever\n    if <<(Effect) = [2]> or <(Effect) = [3]>> then\n        set [ghost v] effect to (45)\n    end\nend\n\nwhen I receive [next slide v]\nnext costume\n\n@End Screen\n\ndefine Decode (e)\ncount zeroes\nset [letter v] to [1]\nset [high score holder v] to []\nset [row v] to [0]\nset [char num v] to [0]\ndelete all of [char nums v]\nrepeat ((zeroes) + (1))\n    set [row v] to []\n    repeat until <(letter (letter) of (☁ Cloud Data)) = [0]>\n        set [row v] to (join (row) (letter (letter) of (☁ Cloud Data)))\n        change [letter v] by (1)\n    end\n    add (row) to [char nums v]\n    change [letter v] by (1)\nend\nset [letter v] to [1]\nrepeat (length of [char nums v])\n    set [high score holder v] to (join (High Score Holder) (item (item (letter) of [char nums v]) of [chars v]))\n    change [letter v] by (1)\nend\n\ndefine Encode (e)\nset [☁ cloud data v] to [0]\nset [letter v] to [1]\nrepeat (length of (e))\n    set [row v] to [1]\n    repeat (length of [chars v])\n        if <(item (row) of [chars v]) = (letter (letter) of (e))> then\n            set [☁ cloud data v] to (join (☁ Cloud Data) (row))\n            set [☁ cloud data v] to (join (☁ Cloud Data) [0])\n        end\n        change [row v] by (1)\n    end\n    change [letter v] by (1)\nend\nset [encoded username v] to (☁ Cloud Data)\n\ndefine count zeroes\nset [zeroes v] to [0]\nset [letter v] to [0]\nrepeat (length of (☁ Cloud Data))\n    if <(letter (letter) of (☁ Cloud Data)) = [0]> then\n        change [zeroes v] by (1)\n    end\n    change [letter v] by (1)\nend\n\nwhen flag clicked\nhide\nhide variable [time v]\nhide variable [high score holder v]\nhide variable [☁ high score v]\nreset timer\n\nwhen I receive [game win v]\ngo to [front v] layer\nset [time v] to (round (timer))\nif <(Time) < (☁ High Score)> then\n    set [☁ high score v] to (Time)\n    Encode (username)\n    Decode (☁ Cloud Data)\nend\nshow variable [time v]\nshow variable [high score holder v]\nshow variable [☁ high score v]\nshow\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n@Favorite\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set [star v] to [1]\n    end\nend\n\n@Love\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set [heart v] to [1]\n    end\nend\n\n@Message\n\nwhen I start as a clone\nset [message v] to [1]\ngo to [front v] layer\nshow\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [message v] to [0]\ndelete this clone\n\nwhen flag clicked\nset [message v] to [0]\nhide\n\n