Blog

Linux, Haxe, NME and IntelliJ

So, I know the existence of Haxe for a looooong time now but I never had the chance / time to play with it. Tonight, this has changed…

This post will walk you through installing/setting up Haxe, NME and IntelliJ to be able to code your next big game.

Haxe and NME

Download the linux Haxe installer from here
And run it like

./nme-installer.sh

Once installed you need to set up haxelib

haxelib setup

The nme library should be already here so no need to install it. Just for your information haxelib is a tool to fetch libraries used by/using haxe. E.g to install libraryX I would do haxelib install libraryX

Now, with Haxe and NME you can target multiple platforms. NME has made setting each environment pretty easy.

For instance, you want to target android? Then you will need Java, Android SDK, Android NDK and Ant. Fastidious to download them all and set them up (if needed)
Now you can do it with

nme setup android

This will run a setup script to download any missing sdks, … or set their path if already downloaded.
Repeat as you wish for the other environment. See here

IntelliJ

Ok, now open your intelliJ, and go in settings > plugins > browse repositories. Find Haxe, and download and install. Finally restart IntelliJ.
Now create a project from scratch in IntelliJ. Choose Haxe module, and add the Haxe SDK for it (the default path is /usr/lib/haxe)

Now you want to add the nme library to your module.
Open the modules setting and add a new Haxe library. Go to /usr/lib/haxe. IntelliJ will list all the libs available, nme included.
Tick it and validate. Adds this library to your current module. And that’s it.

You are now ready to create some kick ass game with Haxe and NME!!!