1. Quick Start: Installation

This guide will get you up and running with the Game Closure DevKit. First, you’ll download and install DevKit, then get introduced to basil, our command-line tool for creating new projects and development. Once everything is installed and ready to go, please read the Hello, World! Guide to create your first application.

This guide is mainly for Linux or OSX. To install on Windows please follow the Windows install guide first.


Install the following software before installing the Game Closure DevKit:

The easiest way to install these packages is through their respective installers. Alternatively, you can use a package manager, such as Homebrew on OSX, to keep your system updated. Just be aware that you’ll need to download and set up the Xcode Command-line Tools to build these packages.

The Chrome web browser is the preferred development environment because of its superior debugging toolset.

If you’re using OSX and building for native devices, you’ll need to install the following from the Apple Developer Site. You may need to advance to the second page of downloads to find each of these items:

  • XCode Command Line tools (November 2012 or newer)
  • XCode (4.4 or newer)

On MacOSX, we recommend editing your game’s JavaScript code with Sublime Text 3 Beta with the NBSP plugin installed.

The NBSP plugin allows you to easily catch extended ASCII multi-character codes like NBSP that tend to find their way into JavaScript files. This leads to hard-to-debug problems where the code looks fine in the editor, but a browser like Chrome will choke when your code is evaluated. Usually the error will be something like Unexpected token {. This can also happen in JSON files you edit.

Once you have Sublime Text 3 installed, to install the NBSP plugin:

  • Open Sublime Text application.
  • In the Sublime Text menu in the upper left, select Preferences => Browse Packages…
  • Your User folder should open in Finder.
  • Drag the sublime_unicode_nbsp.py file from the plugin into your User folder.

Now problematic characters like NBSP will be highlighted in red and you can delete them and replace them with normal spaces.

Install DevKit

With the prerequisites installed, we’re ready to set up the Game Closure DevKit. The library and tools are open source and hosted in our GitHub repository. We’ll be using the git tool to keep our software updated, and there is lots of help available for how to use git.

To download the Game Closure DevKit, issue the following commands at the terminal:

$ git clone https://github.com/gameclosure/devkit

This downloads the DevKit in to the ./devkit directory located in your current working path. A good place to put it would be in your home directory. Switch to that directory and run the install script:

$ cd devkit
$ ./install.sh

This installs the command-line program basil, which is used to create and serve projects. To see a list of basil commands, simply run it in your terminal without any arguments:

$ basil

This prints out a list of basil commands. You can get help for a particular command by typing basil help [command], for example:

$ basil help init

Some commands can also take a -h argument to show help.

Update the DevKit

To keep your copy of the DevKit up to date, run the update command:

$ basil update

The update command is also able to check out older versions of the DevKit or different channels of DevKit versions. Read the help menu with basil update --help for more information on this flexible tool.

Hello, World!

Once basil is installed you’re ready to create a new game project. Take a look at the Hello, World! Guide to see how to get started using the Game Closure DevKit.