HTML5 game engines

The following are few examples of game engines implemented with HTML5 and JavaScript:

  • Construct 2: One of the first WebGL enabled HTML5 game engines. Exports purely to HTML5 and JavaScript. Uses Canvas only and is extensible with JavaScript plugins.
  • Isongenic Engine: One of the most promising engines out there today. Massively multiplayer networking built in, uses Node.js and MongoDB, and has canvas or DOM-based graphics.
  • Impact
  • CutJS: Lightweight, fast, interactable 2D HTML5 rendering engine for game development. Open-source and cross-platform.
  • Canvace
  • Crafty
  • PlayCanvas: A collaborative, cloud-hosted game engine with a visual editor, in-browser code editing and one click publishing.
  • MightyEngine: 2D game engine supporting Web, Android, iOS platforms. Build in editor to manage projects, assets, maps.
  • Game Develop: A game development software exporting to native and HTML5 games. Uses Pixi.js to render using WebGL or canvas.
  • EnchantJS: A simple Javascript framework for creating 2D and 3D HTML5 games. Has good documentation and easy to follow tutorials for getting started
  • WiMi5: A video game platform that eases the creation, publication and monetization processes of HTML5 games, using a cloud based editor.
  • Phaser: 2D game enginge supporting Web, Android, IOS platforms

HTML5 game tools

  • Clay.io: Distribution, Retention, Social and Monetization tools. Easy integration of user accounts, high scores, achievements, cross promotion, in-game payments, analytics etc...
  • Pixi.js: 2D rendering engine using WebGL with a canvas fallback.
  • stat.js: Simple JavaScript performance monitor

Useful technologies

The following can be useful in developing games based on Web technologies.

  • Canvas: 2-D graphics.
  • WebGL: 3-D graphics.
  • Audio: HTML5 element, Web Audio API
  • WebSockets: can be used for real-time communication between a player and the game server, to support multi-player games.
  • Node.js: Node is often used as a multiplayer game server, controlling the logic and handling the WebSockets connections to the players. It can be used for player authentication and the storage of data so game play can persist over multiple game sessions. This is all made relatively easy with great third-party modules, like Socket.IO for WebSockets, and others that handle Redis and MongoDB for storage, for example.
  • DOM Storage is great for storing data locally on the player's device. This way you can cache game data and allow the game to pick up where the player left off.
  • The Full Screen API allows you to expand any HTML element to fill the user's screen, even if the browser isn’t running full-screen itself.
  • Application Cache and the ServiceWorker API: One of the main differences between Web apps and native apps is that native apps can be run offline. Technologies such as Application Cache and Service Worker allow for a website or a Web app to cache necessary assets so it can still run while offline. This includes things like JavaScript files, CSS and images. Combining this technique with intelligent use of things like localStorage will allow your game to continue working even if the Internet connection goes down. You just sync up all the changes when it gets connected again.
  • Emscripten enables you to port a game written in C or C++ over to JavaScript. The Bananabread demo used Emscripten.
  • The Gamepad API is available in latest versions of Firefox and Chrome. What is most interesting about the Gamepad API is that it might be just what finally justifies HTML5 gaming on a TV or console. Who wants to use a keyboard and mouse while sitting on the sofa?
  • The Pointer Lock API is an attempt to improve the mouse as an input device, used in situations such as games and 3D visualizations where the mouse position rotates or moves you around a 3D space. As it stands, there would still be a cursor moving around the screen causing all sorts of trouble when you want to click on something in your game. With this API, you can lock your mouse position and stop it from getting in the way and being a nuisance.

Not every browser supports every part of HTML5. For example, Canvas isn’t supported out of the box by any Internet Explorer below version 9. However, you can use Explorer Canvas to replicate canvas functionality (but that is not ideal and does not perform as well). WebSockets is supported by IE only in IE 10, and it isn’t supported in the stock browser of Android. But again, you can fake this by using Flash for the sockets, such as with Socket.IO. While supported in the latest versions of every other browser, WebGL in Internet Explorer requires at least version 11.

Game template

You can use the Mortar Game Stub template to get a quick start on an HTML5 game, or you can use it to get ideas on best practices.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏菩提树下的杨过

闲来无事,倒腾了一个简单的silverlight视频播放器

近二日闲来无事,把silverlight的官方文档瞅了瞅,倒腾了一个简单的视频播放器,顺便也测试了下能否播放传说中的h.264,最终效果如下: ? http:/...

4079
来自专栏偏前端工程师的驿站

WPF一步一脚印系列(1):万事起头难

  一直从事Asp.Net的开发,而C/S的开发方面简直是一片空白,于是从上星期开始就痛下决心开始学习WPF。我采取的策略是网上看基础资料+做简单的demo练习...

2009
来自专栏云端架构

【云端架构】前端js键盘绑定事件

在Web开发中,有时候我们可能会把页面中的某些按钮绑定到键盘的输入事件中。以下代码能方便实现我们需要的功能。

36010
来自专栏逍遥剑客的游戏开发

XACT Q&A

1535
来自专栏CRPER折腾记

Angular 2 + 折腾记 :(8) 动手写一个不怎么靠谱的上传组件

上传功能在任何一个网站中的地位都是举足轻重的,这篇文章主要扯下如何实现一个上传组件

941
来自专栏c#开发者

datagrid资料+ by iCeSnaker - Program rhapsody

datagrid资料+ by iCeSnaker - Program rhapsody 关于datagrid的打印 http://www.chinaaspx.c...

3399
来自专栏菩提树下的杨过

Flash/Flex学习笔记(32):播放音乐并同步显示lyc歌词(适用于Silverlight)

题外话:个别朋友总是问我同样的问题,做为一名c#/silverlight程序员为啥还要学flash ? 回 答:看日本片时,就不能对照看欧美的么? 不体会日本的...

1787
来自专栏林德熙的博客

WPF 渲染原理

在 WPF 最主要的就是渲染,因为 WPF 是一个界面框架。想用一篇博客就能告诉大家完整的 WPF 渲染原理是不可能的。本文告诉大家 WPF 从开发者告诉如何画...

862
来自专栏菩提树下的杨过

如何在不影响asp.net默认安全性的前提下使用ckeditor/fckeditor?

asp.net默认情况下,不允许提交包含html源代码的表单,这在很大程度上防止了跨站(提交)攻击,但是ckeditor/fckeditor之类的富文本编辑器肯...

2179
来自专栏互联网开发者交流社区

温湿度系统(花葵、库房检测)

793

扫码关注云+社区