Gemstone - A Platformer


@Stage\n\n@player\n\nwhen flag clicked\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        change [x v] by (-1)\n        switch costume to (steve 2 v)\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        change [x v] by (1)\n        switch costume to (steve 1 v)\n    end\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    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n            set [y v] to [17]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<key (up arrow v) pressed?> and <touching (ground v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <touching (nether portal v)?> then\n        go to x: (-217) y: (-20)\n        broadcast (NEXT LEVEL v) and wait\n    end\nend\n\nwhen flag clicked\nset [level v] to [0]\nset [deaths v] to [0]\ngo to x: (-53) y: (-115)\n\nwhen flag clicked\nforever\n    if <(level) = [5]> then\n        broadcast (ok 2 v)\n    end\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\nwhen flag clicked\nforever\n    if <touching (mob v)?> then\n        change [deaths v] by (1)\n        go to x: (-53) y: (-115)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [3]> then\n        broadcast (ok time v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        broadcast (ok time 3  v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [0]> then\n        broadcast (nice v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mob2 v)?> then\n        change [deaths v] by (1)\n        go to x: (-53) y: (-115)\n    end\nend\n\n@ground\n\nwhen flag clicked\nswitch costume to (grass v)\n\nwhen I receive [next level v]\nnext costume\n\ndefine higher score (higher score)\n\nforever\n    if <(timer:) > (☁ Highscore)> then\n        set [☁ highscore v] to (timer:)\n    end\n    if <(☁ Highscore) < (timer:)> then\n        set [☁ highscore v] to (☁ Highscore)\n    end\n    if <(higher score) > (☁ Highscore)> then\n        set [☁ highscore v] to (timer:)\n        add (timer:) to [cloud v]\n    end\nend\n\nadd (☁ Highscore) to [cloud v]\nadd <(☁ Highscore) = [50]> to [cloud v]\nforever\n    if <(timer:) > (☁ Highscore)> then\n        set [☁ highscore v] to (timer:)\n    end\n    if <(level) = [9]> then\n        stop [this script v]\n    end\nend\n\ndefine Cloud\n\n@soil\n\n@mob\n\nwhen flag clicked\nswitch costume to (zombie3 v)\n\nwhen flag clicked\nforever\n    if <(level) = [3]> then\n        show\n        go to x: (-43) y: (28)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [ok time v]\nshow\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        hide\n        switch costume to (blank v)\n    end\nend\n\nwhen I receive [ok 2 v]\nhide\n\n@nether portal\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@thumb\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nshow variable [timer: v]\nset [timer: v] to [0]\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [timer: v] by (1)\nend\n\nwhen flag clicked\nforever\n    play sound [minecraft song v] until done\nend\n\n@mob2\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [ok time 3  v]\nshow\n\nwhen flag clicked\nforever\n    if <(level) = [3]> then\n        hide\n    end\nend\n\nwhen flag clicked\nswitch costume to (zombie2 v)\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        switch costume to (zombie2 v)\n        show\n        go to [front v] layer\n        go to x: (-111) y: (28)\n        wait (1) seconds\n        go to x: (-110) y: (75)\n        wait (1) seconds\n        go to x: (-111) y: (28)\n    end\nend\n\nwhen I receive [ok time v]\nhide\n\nwhen I receive [nice v]\nhide\ngo to [back v] layer\n\n