Getting Started

Basic game template

Put this in a .html file and open it in your browser.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My awesome game</title>
        <style>
            html, body { min-height: 100%; background: #3f3d47; display: flex; flex: 1; margin: 0; justify-content: center; }
            canvas { margin: 100px 0; background: #000; }
            @media (pointer: coarse) {
                html, body { overflow: hidden; }
            }
        </style>
        <script src="../engine.js"></script>
    </head>
    <body>
        <canvas id="game-canvas" style="display: none" oncontextmenu="return false"></canvas>
        <script>
            newGame('game-canvas');

            // Your game code
        </script>
    </body>
</html>