Brandon McInnis , Ryo Shimizu , Hidekazu Furukawa , Ryohei Fushimi , Ryo Tanaka and Kevin Kratzer HTML5 Game Programming with enchant.js 10.1007/978-1-4302-4744-9_1
Brandon McInnis 2013
1. Beginning enchant.js Development
Brandon McInnis 1, Ryo Shimizu , Hidekazu Furukawa , Ryohei Fushimi , Ryo Tanaka and Kevin Kratzer
Abstract
The enchant.js framework was developed at the Ubiquitous Entertainment Inc. (UEI) Akihabara Research Center in Tokyo and was originally released in April, 2011. It has enjoyed considerable popularity in Japan ever since and has a growing base of fans from other countries. The enchant.js framework is an HTML5 and JavaScript-based game engine and stand-alone code library that enables you to develop applications that can run on a PC or Mac or on iPhone, iPad, and Android devices. Although game applications created using the engine can be run on many different kinds of devices, most have been created and optimized for smartphone use.
The enchant.js framework was developed at the Ubiquitous Entertainment Inc. (UEI) Akihabara Research Center in Tokyo and was originally released in April, 2011. It has enjoyed considerable popularity in Japan ever since and has a growing base of fans from other countries. The enchant.js framework is an HTML5 and JavaScript-based game engine and stand-alone code library that enables you to develop applications that can run on a PC or Mac or on iPhone, iPad, and Android devices. Although game applications created using the engine can be run on many different kinds of devices, most have been created and optimized for smartphone use.
The decline of Adobe Flash as an interactive platform in recent years has led modern web game developers to turn to other browser-based and ubiquitous platforms, such as HTML5 and JavaScript, to create browser-based experiences for their users. However, while JavaScript originally was developed to be a language accessible to non-professional developers, the complexity of JavaScript used today for game authoring in the browser often requires a large investment of time to learn and use efficiently. As an open-source game library, enchant.js reduces this complexity by providing game authoring functionality for developers, which significantly minimizes your learning curve for writing browser-based games and increases the speed of your game development.
With this book, you can start creating and publishing games quickly and easily. Dont worry if youre a complete beginner to programming. We take you through all the basics so you can get up and running fast. If you are at an intermediate level, we provide advanced content for you as well. We describe the different parts of the enchant.js framework and create several games, including classic games like Whack-A-Mole and arcade shooters, along the way to acquaint you with all the enchant.js library has to offer.
Visit the enchant.js Web Sites
To get a quick start with enchant.js, take a look at the three main enchant.js web sites. Each site has specific functions that help you create and share games faster and easier.
http://enchantjs.com : download the enchant.js code library, find resources, and read programming tips
http://code.9leap.net : develop, edit, and test games in an online, cloud-based environment
http://9leap.net : upload, play, and share games
The main enchant.js site is where you can learn about the library and download the source code to develop your own games. You can also develop games in an online environment on shows the basic relationship of the sites.
Figure 1-1.
Relationship between the web sites
enchantjs.com
The official enchant.js web site at shows the home page of enchant.js.
Figure 1-2.
enchantjs.com home page
code.9leap.net
On the http://code.9leap.net web site, you can perform HTML/JavaScript editing, testing, and sharing directly within a web browser. The code.9leap.net site supports the import of enchant.js as well as easy uploading to 9leap.net , allowing the entire game development cycle, from programming to publication, to take place in the browser. It can be used on a PC or Mac or on devices such as an iPad.
Figure log-in page. At the time of publication of this book, the site is in a beta stage of development.
Figure 1-3.
code.9leap.net log-in page
9leap.net
The 9leap site at shows the 9leap home page.
Figure 1-4.
9leap.net home page
You can also enter game development contests on the site. Contest finalists win prizes such as the latest PC and Mac computers, bookstore gift cards, and more. Additionally, as part of the 9leap project UEI regularly hosts 9leap game programming camps in Japan and is beginning to host camps in the United States as well. Typically, these camps begin with a seminar on game programming and provide guidance to help participants create a simple game of their own. For more information, see the enchantjs.com web site.
Compatibility and Releases
The following browsers and devices support enchant.js:
Internet Explorer (IE) 9.0 and later
Chrome 10 and later for Mac OS X, Windows, and Linux
Safari 5 and later for Mac OS X and Windows
Firefox 3.6 and later for Mac OS X and Windows
iOS 4 and later for the iPhone and iPad
Android 2.1 and later
Table shows the major releases of enchant.js. At the time of the publication of this book, the latest version of enchant.js is version 0.6.2.
Table 1-1.
Recent Releases and Added Functionality of enchant.js
Version | Functions Added |
---|
0.6.2 (current) | Better performance on Android Improved keybinding |
0.6.1 | Improved WebAudio Improved timeline |
0.6.0 | WebAudio API DOM/Canvas rendering Animation engine Core class |
0.5.2 | Time-based animation (tl.enchant.js) |
0.5.1 | Bug-fixes |
0.5.0 | Sound support on iPhone Support for rotation & scale properties Canvas support ElapsedTime support |
Note
As of version 0.6.1, enchant.js is licensed under the MIT license. Contact Ubiquitous Entertainment ( http://global.uei.co.jp/ ) with inquiries about corporate use of code created with enchant.js.
Features of enchant.js