Elf Quest | A Platformer #Games

Instructions: Use the arrow keys to move, when you get your sword, press the space bar to swing. Hop on the trampoline to jump really high. Avoid falling into lava, getting poked by the spikes, and falling to Hecker's hecks!!!\n

@Stage\n\n@Player\n\nwhen flag clicked\ngo to [front v] layer\nset [x x x v] to [0]\nset [y y y v] to [0]\nhide\ngo to x: (-114) y: (-30)\n\nwhen flag clicked\nset size to (100) %\nhide\nwait (3) seconds\nshow\nforever\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x x x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x x x v] by (-1)\n    end\n    set [x x x v] to ((x x x) * (0.9))\n    change x by (x x 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 x by ((x x x) * (-1))\n                            change y by (-5)\n                            if <touching color (#000000)?> then\n                                if <(x x x) > [0]> then\n                                    set [x x x v] to [-5]\n                                else\n                                    if <touching (ground v)?> then\n                                        set [x x x v] to [5]\n                                    end\n                                end\n                                set [y y y v] to [10]\n                            else\n                                if <touching (ground v)?> then\n                                    set [x x x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y y y v] by (-1)\n    change y by (y y y)\n    if <touching (ground v)?> then\n        change y by ((y y y) * (-1))\n        set [y y y v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        set [y y y v] to [15]\n    end\n    change y by (1)\n    if <touching (danger v)?> then\n        set [y y y v] to [0]\n        repeat (10)\n            change size by (-10)\n        end\n        go to x: (-200) y: (30)\n        set size to (100) %\n    end\n    if <[-180] > (y position)> then\n        repeat (10)\n            change size by (-10)\n        end\n        go to x: (-200) y: (30)\n        set size to (100) %\n    end\n    if <touching (trampoline v)?> then\n        set [y y y v] to [20]\n    end\n    if <touching (wind v)?> then\n        set [x x x v] to [15]\n    end\n    if <(x position) > [230]> then\n        broadcast (next level v)\n        set x to (-200)\n    end\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nset [y y y v] to [0]\n\nwhen flag clicked\nrepeat (10)\n    play sound [sunset- paradise v] until done\nend\n\nwhen I receive [restart v]\ngo to x: (-200) y: (100)\n\nwhen I receive [next level v]\ndelete this clone\n\n@Ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Danger\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Trampoline\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Sprite1\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@Sprite2\n\nwhen this sprite clicked\nbroadcast (restart v)\n\n