Testing your game
How to test locally, preview your game in our player, and check devices and browsers.
Test your game the way players will use it, in a browser and inside a frame. Most problems we find in review come from a game that was only tried one way, in one browser.
Testing locally
Browsers block many features on pages opened straight from a file, so always use a local web server. If you have Node.js installed, run this in the folder that holds your index.html:
npx serve .Or, with Python:
python3 -m http.server 8000Then open the address it prints. Check that:
- the game loads with no errors in the browser console;
- every file loads, with no 404 errors in the network panel;
- the game works from a fresh start, with no saved data.
Testing inside a frame
KoolGames runs your game inside an iframe. To see how it behaves, create a file called test.html next to your game:
<!doctype html>
<title>Frame test</title>
<iframe
src="index.html"
width="960"
height="540"
allow="autoplay; fullscreen; gamepad; accelerometer; gyroscope"
sandbox="allow-scripts allow-same-origin allow-pointer-lock allow-popups allow-forms allow-orientation-lock"
></iframe>Those are the same permissions our player gives your game. Open test.html through your local server and play through the game. Look out for:
- code that tries to reach the parent page, which won't work;
- keyboard input that only works after a click, which is normal in a frame, so show players a Start button;
- content that gets cut off, which usually means the game isn't scaling to the size of its frame.
See how your game page will look
The demo game page shows the real layout your game will use: the player, the toolbar, the details and the ad spaces.
Devices and browsers
Before you submit, test on every device type you plan to tick on the form:
- Desktop: the current versions of Chrome, Firefox, Safari and Edge.
- Tablet: Safari on iPad and Chrome on Android, in the orientation you support.
- Mobile: Safari on iPhone and Chrome on Android, using touch only.
On each one, check the controls, the sound and the frame rate, and rotate the device to see what happens. iPhone Safari doesn't support the browser's fullscreen feature, so our player fills the screen a different way there. Make sure your game still scales properly.
Before you submit
- The game runs from start to finish with no errors.
- A first-time player can work out the controls.
- Sound starts only after the player has pressed something, because browsers block it until then.
- It works in a frame at 960×540 and at a larger size.