Platformer Sample
@Stage\n\n@player\n\nwhen flag clicked\nset [gravity v] to [0]\nset [coins v] to [0]\nhide variable [gravity v]\nset x to (-200)\nset y to (-60)\nforever\n    if <(gravity) > [-10]> then\n        change [gravity v] by (-1)\n    end\n    if <touching (ground v)?> then\n        set [gravity v] to [0]\n        switch costume to (p1_stand v)\n    else\n        change y by (gravity)\n        switch costume to (p1_jump v)\n    end\n    if <key (right arrow v) pressed?> then\n        change x by (5)\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        change x by (-5)\n        point in direction (-90)\n    end\n    if <(y position) < [-150]> then\n        start sound [gameover v]\n        switch costume to (p1_hurt v)\n        wait (1) seconds\n        stop [all v]\n    end\n    if <color (#6ec3a8) is touching (#80be1f)?> then\n        change y by (5)\n    end\n    if <<touching color (#c99869)?> or <touching color (#c58f5c)?>> then\n        if <key (right arrow v) pressed?> then\n            change x by (-5)\n        end\n        if <key (left arrow v) pressed?> then\n            change x by (5)\n        end\n    end\nend\n\nwhen [space v] key pressed\nif <touching (ground v)?> then\n    set [gravity v] to [15]\n    change y by (10)\n    start sound [jump v]\nend\n\ndefine the meaning of life\nsay [42]\n\n@ground\n\n@coin\n\nwhen flag clicked\nshow\nforever\n    if <touching (player v)?> then\n        change [coins v] by (1)\n        hide\n        start sound [coin v]\n    end\nend\n\n
Arrow keys to move, spacebar to jump.