Installation

In order to get up and running Heaps you’ll need to install Haxe (the language), Visual Studio Code (the editor) and Heaps itself (the engine).

Installing Haxe

Heaps works on Haxe 3.4.2+, though it is recommanded to install Haxe 4+ to enjoy new language features and support the HashLink compiler target.

Installation - 图1 Download Haxe 4+

Installing Heaps using haxelib

haxelib is the library manager utility of haxe. It is used to download and install published versions of popular code libraries.

In your command line interface of choice, run:

  1. haxelib install heaps

Note that in some cases you might need to log out and log back into your computer for haxlib to be recognized as a command.

You can also install directly from github to get the latest, bleeding-edge version of Heaps.

  1. haxelib git heaps https://github.com/HeapsIO/heaps.git

Installing Visual Studio Code

The recommended editor for creating Heaps applications is Visual Studio Code:

Installation - 图2 Visual Studio Code

If your VSCode is up to date (after v1.31), you’re good to go. Otherwise, restart VSCode once installation is complete (you can click the Reload label that should be showing, or hit Ctrl+Shift+P and type “Reload Window”, then hit Enter)

Installing Haxe extensions on vscode

This step will setup Haxe language support for vscode, the easier generation of comments and debuggers for some compilation targets.

Click on the Extension panel (fourth icon on the left side bar of VSCode), search haxe and install Haxe Extension Pack that will contain everything you need for Haxe support.

Installation - 图3

While Haxe and Heaps can out of the box compile to an expanding list of targets, follow these additional steps to be able to compile to HashLink, a Haxe virtual machine axed on high performance and quick compilation.

Download and install the HashLink Virtual Machine

On OSX, you will have to follow the instructions laid out here to get set up with Hashlink, as the process is a little different.

Once you’ve downloaded the HashLink binary you’ll want to add it to your system PATH (tutorial).

Update Haxe

Make sure you are using at least Haxe 4+.
To confirm your current version of Haxe, type haxe --version in the command line.

Install additional libraries

Using haxelib install in the command line, install the following items:

  1. haxelib install hlopenal
  2. haxelib install hlsdl
  3. haxelib install hldx

Verify the installation

Once everything is setup, you should be able to run hl command from your terminal:

image