There are several ways to create games and applications in enchant.js. Please note that this list does not include the Maeda Block development environment derived from enchant.js.
- develop using code.9leap
- develop using jsdo.it
- develop with the file system
- develop on a local server
- develop on a remote server
Develop using code.9leap
Develop using jsdo.it
jsdo.it is a web development environment sponsored by KAYAC Inc., which can also be used for enchant.js.
Develop with the (local) file system
For example, please open the file /examples/beginners/hellobear/index.html, included in the download package (live version) in your browser. Editing the file main.js, which is in the same folder as index.html, and then reopening index.html will allow you to check the results of your code. Various types of text editors are available for editing your code. Mac editors include CotEditor and mi, while Windows has Terapad and Sakura Editor. Programming environments called IDEs are also convenient, as they have many features which manage multiple projects and their associated files. Well-known ones include Eclipse, Aptana, WebStorm.
Due to the specs of some browsers such as Google Chrome and Firefox not supporting certain functions, some games may be prevented from starting. Examples of this include:
- loading model data fails when using gl.enchant.js
- loading sound files fails when trying to use sound
These issues can be avoided by setting the browser’s launch options (Chrome only) before opening.
Another option is to develop while checking the game’s performance through a local web server, explained in the next section.
: Since the local copy of the origin file points to file names, access is restricted based on the Same Origin Policy. This is active for releases of Google Chrome from version 5 on.
Developing with a web server
Development can be carried out via a local web server, such as apache, which can be installed very easily using a package such as MAMP (Mac) or XAMPP (Windows). This does not use a server connected to the internet necessarily, but is simply a method for circumventing restrictions caused by browser specs.
In this instance, the file being edited is stored and locally, but the html file is viewed by way of the local web server. Those who want to utilize a remote web server can also do so without problems.
This post is also available in: Japanese