Sunny a Platformer

Instructions: Use the arrow keys or WASD to move.\n\nSpace to read a sign\n\nAvoid red spikes\n\nPurple Trampolines are bouncy\n\nr to restart

@Stage\n\nwhen flag clicked\nforever\n    play sound [Avicii - Levels-\[www_2conv_com\]2 v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\nset [level v] to [1]\ngo to x: (-200) y: (-100)\ngo to [front v] layer\nshow\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.88))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (-4)\n                        change x by ((0) - (x))\n                        set [x v] to [0]\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (ground v)?>> then\n        set [y v] to [14]\n    end\n    change y by (1)\n    if <<(x position) > [240]> or <key (s v) pressed?>> then\n        hide\n        broadcast (Next Level v) and wait\n        set [x v] to [0]\n        set [y v] to [0]\n        go to x: (-200) y: (-120)\n        show\n    end\n    if <<touching (spikes v)?> or <key (r v) pressed?>> then\n        go to x: (-200) y: (-120)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\n    if <(y position) < [-175]> then\n        go to x: (-200) y: (-120)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\n    if <touching (jump pad v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v] to [26]\n        else\n            set [y v] to [22]\n        end\n    end\nend\n\n@Ground\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Clouds\n\nwhen flag clicked\nclear graphic effects\nhide\nforever\n    set [speed v] to (pick random (3) to (5))\n    create clone of (_myself_ v)\n    wait (pick random (0.5) to (3.)) seconds\nend\n\nwhen I start as a clone\ngo to [back v] layer\nclear graphic effects\nswitch costume to (pick random (1) to (5))\nset [ghost v] effect to (50)\ngo to x: (300) y: (pick random (-150) to (150))\nshow\nrepeat until <(x position) < [-300]>\n    change x by ((0) - (Speed))\nend\ndelete this clone\n\n@Sun\n\nwhen flag clicked\ngo to [back v] layer\nclear graphic effects\nswitch costume to (rays v)\ngo to x: (210) y: (170)\ncreate clone of (_myself_ v)\nforever\n    turn right (1) degrees\nend\n\nwhen I start as a clone\nswitch costume to (sun v)\n\nwhen I receive [dead v]\nset [brightness v] effect to (-100)\nrepeat (50)\n    change [brightness v] effect by (2)\nend\n\n@Next Level\n\nwhen I start as a clone\nset size to (200) %\nset [ghost v] effect to (25)\nswitch costume to (pick random (1) to (5))\nif <(pick random (1) to (2)) = [1]> then\n    go to x: (pick random (-300) to (300)) y: (300)\n    set [random v] to [1]\nelse\n    go to x: (pick random (-300) to (300)) y: (-300)\n    set [random v] to [2]\nend\nshow\ngo to [front v] layer\nif <(Random) = [1]> then\n    repeat until <(y position) < [-190]>\n        change y by ((0) - (Speed))\n    end\nelse\n    repeat until <(y position) > [190]>\n        change y by (Speed)\n    end\nend\ndelete this clone\n\nwhen I receive [next level v]\nhide\nrepeat (25)\n    set [speed v] to (pick random (6) to (8))\n    create clone of (_myself_ v)\nend\nchange [level v] by (1)\nrepeat (25)\n    set [speed v] to (pick random (6) to (8))\n    create clone of (_myself_ v)\nend\n\n@Sign\n\nwhen flag clicked\nset size to (75) %\nhide\nCreate Sign at [0] [-95] on level [1] text [Welcome to Sunnytown, where it is always sunny. Use the arrow keys or WASD to move.]\nCreate Sign at [-100] [-95] on level [2] text [Use the up arrow or W to jump.]\nCreate Sign at [-100] [-95] on level [3] text [Watch out for spikes!]\nCreate Sign at [-100] [-95] on level [4] text [Long Jump.]\nCreate Sign at [-100] [-95] on level [5] text [Trampolines are bouncy!]\nCreate Sign at [-100] [135] on level [6] text [Choose a path.]\n\ndefine Create Sign at (x) (y) on level (level) text (words)\nwait until <(Level) = (level)>\ngo to x: (x) y: (y)\nset [cl v] to (level)\nset [text v] to (words)\nswitch costume to (sign v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        set [brightness v] effect to (25)\n        switch costume to (sign2 v)\n    else\n        set [brightness v] effect to (0)\n        switch costume to (sign v)\n    end\n    if <<key (space v) pressed?> and <touching (player v)?>> then\n        set [touching v] to [1]\n        set [so far v] to []\n        set [i v] to [1]\n        repeat (length of (Text))\n            say (join (So far) (letter (i) of (Text)))\n            set [so far v] to (join (So far) (letter (i) of (Text)))\n            change [i v] by (1)\n            wait (0.01) seconds\n        end\n    else\n        if <(Touching) = [0]> then\n            say []\n        end\n    end\n    if <not <touching (player v)?>> then\n        set [touching v] to [0]\n    end\n    if <not <(CL) = (Level)>> then\n        delete this clone\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Jump Pad\n\nwhen flag clicked\nhide\nCreate Pad at [-40] [-130] on level [5]\nCreate Pad at [-200] [-130] on level [6]\nCreate Pad at [-210] [-130] on level [9]\nCreate Pad at [-150] [-130] on level [10]\nCreate Pad at [0] [-130] on level [10]\nCreate Pad at [150] [-130] on level [10]\nCreate Pad at [-210] [-130] on level [11]\nCreate Pad at [-105] [-130] on level [11]\nCreate Pad at [-7] [-130] on level [11]\nCreate Pad at [93] [-130] on level [11]\n\ndefine Create Pad at (x) (y) on level (level)\nwait until <(Level) = (level)>\nset size to (50) %\nset [clonelevel v] to (level)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nswitch costume to (pad1 v)\nforever\n    if <touching (player v)?> then\n        repeat (3)\n            next costume\n            wait (0.001) seconds\n        end\n        repeat (3)\n            switch costume to ((costume [number v]) - (1))\n            wait (0.001) seconds\n        end\n    end\n    if <not <(Level) = (CloneLevel)>> then\n        delete this clone\n    end\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [end v]\ndelete this clone\n\n@Thumb\n\nwhen flag clicked\nhide\n\n