~Green~ A Platformer

Instructions: ----------------------------------Green--------------------------------------\nArrows to move\nM- Mute\nU- Unmute\nDon't touch spikes or fall down\nThis game is a fairly easy game.

@Stage\n\n@Player\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (-201) y: (-26)\n\nwhen flag clicked\nset [level v] to [0]\nforever\n    change [y v] by (-0.5)\n    set [x v] to ((x) * (0.9))\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 (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change y by (-6)\n                                if <key (up arrow v) pressed?> then\n                                    set [y v] to [10]\n                                    if <(x) > [0]> then\n                                        set [x v] to [-10]\n                                    else\n                                        set [x v] to [10]\n                                    end\n                                else\n                                    change x by ((x) * (-1))\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching (ground v)?> and <key (up arrow v) pressed?>> then\n        set [y v] to [10]\n    end\n    change y by (0.5)\n    if <(x position) > [230]> then\n        broadcast (message1 v)\n    end\n    if <(y position) < [-150]> then\n        go to x: (-201) y: (-26)\n    end\n    if <touching (spikers v)?> then\n        go to x: (-201) y: (-26)\n    end\n    if <touching (spikers2 v)?> then\n        go to x: (-201) y: (-26)\n    end\n    if <touching (portal v)?> then\n        broadcast (We're in the endgame now v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        change [x v] by (.75)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-0.75)\n    end\nend\n\nwhen I receive [message1 v]\ngo to x: (-201) y: (-26)\nchange [level v] by (1)\n\n@Ground\n\nwhen flag clicked\nshow\ngo to [back v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [message1 v]\nnext costume\n\n@Text\n\nwhen flag clicked\nshow\ngo to [back v] layer\nswitch costume to (costume1 v)\ngo [forward v] (1) layers\n\nwhen I receive [message1 v]\nnext costume\n\n@Spikers\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    if <(level) = [6]> then\n        show\n        switch costume to (costume1 v)\n    end\n    if <(level) = [6]> then\n        go to x: (36) y: (28)\n    end\n    if <(level) = [7]> then\n        hide\n    end\n    if <(level) = [8]> then\n        show\n        switch costume to (costume1 v)\n    end\n    if <(level) = [8]> then\n        go to x: (36) y: (28)\n    end\n    if <(level) = [9]> then\n        hide\n    end\n    if <(level) = [10]> then\n        show\n        switch costume to (costume2 v)\n    end\n    if <(level) = [10]> then\n        go to x: (-145) y: (135)\n    end\n    if <(level) = [11]> then\n        hide\n    end\nend\n\n@Spikers2\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [10]> then\n        show\n        switch costume to (costume1 v)\n    end\n    if <(level) = [10]> then\n        go to x: (38) y: (20)\n    end\n    if <(level) = [11]> then\n        hide\n    end\nend\n\n@portal\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [14]> then\n        show\n        go to x: (8) y: (-39)\n        repeat (35)\n            change [whirl v] effect by (25)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    change [portal y v] by (7)\n    change y by ([sin v] of (portal y) )\nend\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (-2) y: (8)\n\nwhen I receive [we're in the endgame now v]\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [we're in the endgame now v]\nwait (1.5) seconds\nshow\ngo to [front v] layer\nwait (2) seconds\nstop [all v]\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Music\n\nwhen flag clicked\nstart sound [thefatrat-unity-youtubemp3free v]\nforever\n    if <key (m v) pressed?> then\n        stop all sounds\n    end\n    if <key (u v) pressed?> then\n        start sound [thefatrat-unity-youtubemp3free v]\n    end\nend\n\n