Rocky Canyon | Scrolling Platformer

Instructions: ⓦⓔⓛⓒⓞⓜⓔ to Pusheen Platformer!\nYay-- first platformer out! \n*Use the arrow keys or WAD to move around. \n*Press space to restart a level.\nSorry, there are only 10 levels! :/\n

@Stage\n\nwhen flag clicked\nforever\n    play sound [.mp3 v] until done\nend\n\n@Player\n\nwhen flag clicked\nset size to (115) %\ngo to [front v] layer\nshow\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-150) y: (-50)\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.85)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.85)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n        change y by (1)\n        if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n            change y by (1)\n            if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n                change y by (1)\n                if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n                    change y by (1)\n                    if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n                        change y by (1)\n                        if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n                            change y by (1)\n                            if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                                if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                    if <(Xv) > [0]> then\n                                        set [xv v] to [-5]\n                                    else\n                                        set [xv v] to [5]\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    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#88d848)?> or <<touching color (#ffaa66)?> or <<touching color (#97deff)?> or <<touching color (#ffbbe6)?> or <<touching color (#9e9eff)?> or <<touching color (#ffe166)?> or <touching color (#ffaaaa)?>>>>>>> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [12]\n        end\n    end\n    if <<touching color (#69aaf4)?> or <touching color (#7bc5f5)?>> then\n        set [yv v] to [1]\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xv v] by (0.6)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [xv v] by (-0.6)\n        end\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            change [yv v] by (6.5)\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            change [yv v] by (-0.85)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#ffffff)?> or <key (r v) pressed?>> then\n        repeat (10)\n            change size by (-10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-150) y: (-50)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n            change size by (10)\n        end\n    end\n    if <touching (finish v)?> then\n        repeat (10)\n            change size by (-10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        broadcast (Level Passed v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-150) y: (-50)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n            change size by (10)\n        end\n    end\nend\n\nwhen I receive [fin v]\nforever\n    hide\n    go to [back v] layer\nend\n\n@Levels\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nforever\n    set [level v] to (costume [number v])\nend\n\nwhen I receive [level passed v]\nnext costume\nif <(costume [number v]) = [9]> then\n    broadcast (Fin v)\nend\n\n@Finish\n\nwhen flag clicked\ngo to x: (160) y: (-60)\nshow\ngo to [front v] layer\nforever\n    turn right (10) degrees\n    if <(Level) = [1]> then\n        switch costume to (1 v)\n        go to x: (160) y: (-65)\n    end\n    if <(Level) = [2]> then\n        switch costume to (2 v)\n        go to x: (160) y: (-60)\n    end\n    if <(Level) = [3]> then\n        switch costume to (3 v)\n        go to x: (160) y: (-65)\n    end\n    if <(Level) = [4]> then\n        switch costume to (4 v)\n        go to x: (160) y: (-65)\n    end\n    if <(Level) = [5]> then\n        switch costume to (5 v)\n        go to x: (160) y: (-65)\n    end\n    if <(Level) = [6]> then\n        switch costume to (6 v)\n        go to x: (160) y: (-60)\n    end\n    if <(Level) = [7]> then\n        switch costume to (7 v)\n        go to x: (160) y: (-60)\n    end\n    if <(Level) = [8]> then\n        switch costume to (8 v)\n        go to x: (160) y: (-60)\n    end\nend\n\nwhen I receive [fin v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    show\n    go to [front v] layer\nend\n\ngo to [front v] layer\nshow\nclear graphic effects\n\n