Global Warming // A Mobile-Friendly Platformer

Instructions: PART 3 IS NOW OUT! https://scratch.mit.edu/projects/319375475/\n\nControls - \nMobile - Tap or swipe\nComputer - Arrow keys\nPress S to skip a level\n\nTiny Square made his way out of the caves - but must find his home. When he arrives home, a surprise awaits him...

@Stage\n\n@Player\n\nwhen flag clicked\ngo to [front v] layer\nbroadcast (Start v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [start v]\nswitch costume to (costume1 v)\npoint in direction (90)\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    set rotation style [left-right v]\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <key (left arrow v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <key (right arrow v) pressed?>> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#676767)?> then\n        change y by (1)\n        if <touching color (#676767)?> then\n            change y by (1)\n            if <touching color (#676767)?> then\n                change y by (1)\n                if <touching color (#676767)?> then\n                    change y by (1)\n                    if <touching color (#676767)?> then\n                        change y by (1)\n                        if <touching color (#676767)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<mouse down?> and <(y position) < (mouse y)>> or <key (up arrow v) pressed?>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-7]\n                                else\n                                    set [xv v] to [7]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <touching color (#676767)?> then\n        if <<<mouse down?> and <(y position) < (mouse y)>> or <key (up arrow v) pressed?>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#676767)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    hide variable [xv v]\n    if <(x position) > [230]> then\n        broadcast (next level v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-200) y: (-40)\n        set [ghost v] effect to (0)\n    end\n    if <(y position) < [-158]> then\n        go to x: (-200) y: (80)\n    end\n    if <touching color (#9f9f9f)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-200) y: (-40)\n        set [ghost v] effect to (0)\n    end\n    if <touching color (#c355f2)?> then\n        set [yv v] to [18]\n    end\n    set [xv v] to (Xv)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\ngo to x: (-159) y: (-69)\nglide (1) secs to x: (-8) y: (-69)\nwait (1) seconds\nsay [Kitty! I'm home!] for (2) seconds\nswitch costume to (costume3 v)\nwait (1) seconds\nswitch costume to (costume4 v)\nwait (1) seconds\nswitch costume to (costume2 v)\nwait (1) seconds\nswitch costume to (costume1 v)\nwait (.5) seconds\nsay [KITTY!] for (2) seconds\nbroadcast (REAL end v)\nhide\n\nwhen flag clicked\nforever\n    play sound [2018-04-13_-_Sad_Winds_Ch_2_-_David_Fesliyan v] until done\nend\n\n@Platforms\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\nif <(costume [number v]) = [13]> then\n    broadcast (end v)\nend\n\nwhen [s v] key pressed\nbroadcast (next level v)\n\nwhen I receive [real end v]\nswitch costume to (costume14 v)\nstop [all v]\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n