Moon - 360° Platformer Engine
@Stage\n\n@Sprite\n\nwhen flag clicked\nset [yv v] to [0]\nset [xv v] to [0]\nset [level v] to [1]\nset [jumps v] to [0]\nswitch costume to (costume1 v)\nshow\nset [lr v] to [0]\nset [ud v] to [100]\ngo to x: (0) y: (50)\nset rotation style [all around v]\nforever\n    repeat until <not <touching (platforms v)?>>\n        set [blah v] to [0]\n        tick\n        broadcast (tick v)\n        set [ud v] to ((y position) + (0.1))\n    end\n    set [blah v] to [1]\n    tick\n    broadcast (tick v)\nend\n\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <(Xv) > [0]> then\n        set [xv v] to [-8]\n    else\n        set [xv v] to [8]\n    end\n    set [yv v] to [13]\nelse\n    set [xv v] to [0]\nend\n\nchange y by (1)\n\nif <<touching (sprite2 v)?> or <<touching (sprite5 v)?> or <touching (sprite6 v)?>>> then\n    set [yv v] to [20]\nend\nif <touching (sprite3 v)?> then\n    start sound [Crunch v]\n    go to x: (-193) y: (-77)\nend\n\nwhen I receive [lvl start v]\ngo to x: (-193) y: (-77)\n\nwhen I receive [next level v]\ngo to x: (-193) y: (-77)\nchange [level v] by (1)\n\nchange [lr v] by (1)\n\nchange [ud v] by (1)\n\nchange [lr v] by (1)\n\nchange [ud v] by (-5)\n\nchange [ud v] by (-5)\n\nchange [ud v] by (-5)\n\nchange [ud v] by (1)\n\ndefine tick\nchange [lr v] by (x position)\nif <(blah) = [1]> then\n    set [ud v] to ((y position) + (.01))\nend\npoint towards (platforms v)\ngo to x: (0) y: (UD)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xv v] by (1)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xv v] by (-1)\nend\nset [xv v] to ((Xv) * (.8))\nchange x by (Xv)\nrepeat (5)\n    if <touching (platforms v)?> then\n        change y by (.01)\n    end\nend\nif <touching (platforms v)?> then\n    change x by ((Xv) * (-1))\nend\nchange [yv v] by (-1)\nchange y by (Yv)\nchange y by (-1)\nif <touching (platforms v)?> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nif <touching (platforms v)?> then\n    set [jumps v] to [0]\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <(jumps) = [0]> then\n        set [jumps v] to [1]\n        set [yv v] to [10]\n    end\nend\nchange y by (1)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (125)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (UD)\n\ngo to x: (0) y: (UD)\n\nwait until \n\nrepeat until <not >\nend\n\nset [lr v] to [0]\n\n@platforms\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [tick v]\ngo to x: (0) y: ((UD) * (-1))\npoint in direction ((LR) * (-1))\n\n@TB\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n