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.

转载于:https://www.cnblogs.com/pangguoming/p/4242621.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
AutoJS是一款在Android设备上运行JavaScript脚本的工具,其内置了一系列强大的引擎,提供了广泛的功能和特性。 AutoJS提供了多个引擎,比如Rhino、Nashorn以及Duktape等。这些引擎可以运行JavaScript代码,并且支持访问设备的API。比如,Rhino引擎是一个基于Java的JavaScript引擎,可以很方便地与Android系统的API进行交互。它支持访问设备的各种传感器、摄像头以及其他硬件设备,同时还可以调用Android自带的各种功能,如打电话、发短信等。而Nashorn引擎则是基于JVM的JavaScript引擎,可以快速执行JavaScript代码,提供了更高性能的运行环境。 在编写AutoJS脚本时,我们可以根据自己的需求选择合适的引擎。各个引擎有着不同的特点和功能,我们可以根据需要灵活地进行选择。而且,AutoJS还提供了一些辅助函数和工具类,方便我们使用API,简化了开发过程。 通过AutoJS引擎,我们可以编写各种脚本,比如自动化操作、批量处理、UI自动化测试等。它提供了一种简单而强大的方式来自动化我们的Android设备,提高我们的工作效率。无论是普通用户还是开发者,都可以借助AutoJS引擎来实现自己的需求。 总之,AutoJS引擎是一款功能强大的工具,可以让我们在Android设备上运行JavaScript脚本,实现各种自动化操作。它提供了多种引擎和API,方便我们进行开发,并且具有丰富的功能和特性。无论是用于个人使用还是专业开发,AutoJS都是一个非常有用的工具。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值