Create 2D Games with HaxeFlixel
HaxeFlixel is a free and easy-to-use cross-platform 2D game engine built with the Haxe programming language and the OpenFL framework.
It is available for several platforms, such as: Windows, macOS, Android, iOS, Web and GNU/Linux.
It is free and open source software, released under the MIT license. The compiler, written in OCaml, is released under the GNU General Public License (GPL) version 2.
To use HaxeFlixel you will first need the Haxe programming language installed on your system. The procedure for all operating systems can be found on the download page, for Windows for example there are already pre-compiled binaries, that is, just run a
.exe file and then add the path to the environment variable.
Some quick installation examples:
After properly installing the Haxe programming language, now just install HaxeFlixel as follows:
Use the Haxe package manager(haxelib) that will be available and install the following packages:
Creating a basic example
Create a project/folder and enter it through the terminal: Windows Terminal, PowerShell, Ubuntu Terminal,… run the command:
This will create a folder named HelloWorld with all the files needed for your project.
Inside the HelloWorld folder in your project there will be a subfolder called
source and in it a file:
PlayState.hx, open this file with your preferred code editor;
Remembering that there are extensions for Haxe in VS Code, Vim, Neovim and among many others, including for the IDE Visual Studio.
Insert this code to the file
Now in the terminal, run:
The likely result will be similar to the image below:
See demos running in the browser: https://haxeflixel.com/demos/.
For more information see the links below: