Stuck on your game? Start here
This page helps you make a game that works on the site, fix common problems, and get help from Ram if you are still stuck.
What a game needs
- One HTML file. Put your HTML, CSS and JavaScript in a single .html file. Games split into many files often break when downloaded.
- No logins and no outside servers. Games must work offline after they are downloaded, even at school.
- Fits any screen. Use percentages or
vw/vhsizes so it works in the Play here window and on phones. - Keyboard, mouse and touch. Try to support at least two of these.
- Math inside. Every game on the site teaches or practices some math.
Common problems and fixes
- My game is blank in Play here. Open your browser's console (F12) and look for red errors. A missing file or a typo stops the whole script.
- Saving scores crashes. Some browsers block
localStoragein frames. Wrap it:try{localStorage.setItem('best',s)}catch(e){}. - Keys scroll the page. Call
e.preventDefault()for arrow keys and Space inside your keydown handler. - Sound does not play. Browsers only allow sound after a click or key press. Start your
AudioContextinside a click handler. - It is too small or blurry. Size your canvas to the window and multiply by
devicePixelRatio.
Before you send it
- Play it from start to game over at least 3 times.
- Test it on a Chromebook or a small window.
- Use a nickname for credit, not your full name.
- Send it on Submit a program. Already on the site? Use Update a game.