✭ Campaign Platformer ✭

Instructions:                       ✭ Campaign Platformer ✭\n\n♕ Use the arrows to advance or jump ;) !\n♕ Don't touch the spikes !\n♕ Win and have fun ;) !

@Stage\n\n@player\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (-145) y: (-58)\n\nwhen flag clicked\nforever\n    play sound [the piano moosic v] until done\nend\n\nwhen I receive [change v]\nnext costume\n\nwhen I receive [start v]\nswitch backdrop to (blue sky 2  v)\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\nglide (0.25) secs to x: (-200) y: (0)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        change [xv v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                        end\n                        if <key (up arrow 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 [yv v] to [0]\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 (level v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <(x position) > [220]> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        start sound [Magic Spell v]\n        broadcast (new v)\n        go to x: (-200) y: (0)\n    end\n    if <[-160] > (y position)> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        start sound [Oops v]\n        repeat (20)\n            change [ghost v] effect by (5)\n            change size by (.2)\n            change [fisheye v] effect by (50)\n        end\n        set size to (15) %\n        clear graphic effects\n        go to x: (-200) y: (0)\n        go to x: (-200) y: (0)\n        set size to (100) %\n    end\n    if <touching (spikes v)?> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        start sound [Oops v]\n        repeat (20)\n            change [ghost v] effect by (5)\n            change size by (.2)\n            change [fisheye v] effect by (50)\n        end\n        set size to (15) %\n        clear graphic effects\n        go to x: (-200) y: (0)\n        set size to (100) %\n    end\n    if <touching (bounces v)?> then\n        set [yv v] to [22]\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nswitch backdrop to (rays v)\nset [color v] effect to (2)\nset [brightness v] effect to (10)\nglide (1) secs to x: (0) y: (0)\nclear graphic effects\n\n@level\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nshow\n\nwhen I receive [new v]\nif <(costume [name v]) = [10]> then\n    broadcast (end v)\nelse\n    next costume\nend\n\nwhen flag clicked\nwait until <(costume [name v]) = [4]>\nbroadcast (lvl 4 v)\n\nwhen flag clicked\nwait until <(costume [name v]) = [7]>\nbroadcast (lvl 7 v)\n\nwhen flag clicked\nwait until <(costume [name v]) = [8]>\nbroadcast (lvl 8 v)\n\nwhen flag clicked\nwait until <(costume [name v]) = [9]>\nbroadcast (lvl 9 v)\n\nwhen flag clicked\nwait until <(costume [name v]) = [3]>\nbroadcast (lvl 3 v)\n\nwhen flag clicked\nwait until <(costume [name v]) = [10]>\nbroadcast (lvl 10 v)\n\nwhen I receive [end v]\nswitch costume to (1 v)\nstop [other scripts in sprite v]\n\n@spikes\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nshow\n\nwhen I receive [new v]\nif <(costume [name v]) = [10]> then\n    broadcast (end v)\nelse\n    next costume\nend\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\n@change\n\nwhen flag clicked\nshow\n\nwhen this sprite clicked\nbroadcast (change v)\n\nwhen I receive [start v]\nhide\n\n@play\n\nwhen flag clicked\nswitch backdrop to (stripes v)\nset size to (100) %\nshow\n\nwhen this sprite clicked\nbroadcast (start v)\nrepeat until <(size) = [0]>\n    change size by (-10)\n    change [ghost v] effect by (10)\n    wait (0.0000000001) seconds\nend\nclear graphic effects\nhide\n\nwhen I receive [start v]\nhide\n\n@level2\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (-110)\nshow\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen I receive [lvl 4 v]\nset size to (50) %\ngo to x: (200) y: (-85)\n\nwhen I receive [lvl 7 v]\nset size to (85) %\ngo to x: (30) y: (-50)\n\nwhen I receive [lvl 3 v]\nset size to (50) %\ngo to x: (0) y: (-85)\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\n@Bounces\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen I receive [lvl 8 v]\nswitch costume to (1 v)\nshow\n\nwhen I receive [lvl 9 v]\nswitch costume to (2 v)\nshow\n\nwhen I receive [new v]\nhide\n\nwhen I receive [lvl 10 v]\nswitch costume to (3 v)\nshow\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\n@Miniature\n\nwhen flag clicked\nhide\n\n