How to Make an HTML5 Game (part 2)
How to distribute a HTML5 game
The easiest way to distribute a HTML5 is to simply put it out there! By being built as a website, you can just embed it in on a page and publish it. Just like that.
If you want to distribute it through proprietary platforms you have to go through a process called wrapping. Basically, you create a native app for the platform you wanna distribute it to (iOS, Android, etc) and put your game inside so that this app acts like a web browser and “runs” your game.
For desktop platforms such as Windows, Mac or Linux there is a tool called node webkit that allows you to pack your HTML5 games for these platforms.
We can only cover the basics here, but we encourage you to read our more in-depth advice about publishing games.
HTML5 game frameworks
Most games share some concepts, that of sprites (graphic elements that represent enemies, players, elements in your game), scenes or stages, animations, sound, loading graphic assets, etc. Since most game developers want to focus on their actual game and not in creating this whole abstraction layer, it is recommended you use a HTML5 game frameworks.
HTML5 game frameworks and libraries that contain building components you can use to create your own games. These libraries are Open Source projects created and maintained by people who want to contribute to the HTML5 gamedev environment. In many cases they created the frameworks for their own games, and after realizing that other people would want to not only use it but also contribute to it they released them as Open Source code, so everybody wins.
Picking what game engine to use is an important decision, so make sure you do proper research before making your choice. No matter what engine you pick, you will have to get familiar with its code and inner working if you want to use properly, so they shouldn’t be treated as black boxes.
What can help you make your choice:
- Is your game for desktop, mobile or both?
- Do they have an active community?
- Are there many people using the framework nowadays?
- Is it being maintained or the Github page looks like an abandoned town?
Sometimes looking at real games gives you more insight than just words. This project compares different engines by making the exact same Breakout game in all of them.
Some popular free frameworks are:
- Phaser –> The most popular these days
- BabylonsJS –> WebGL framework for 3D rendering