A lightweight and simple base structure for games, using Heaps framework and Haxe language.
Latest release notes: View changelog.
- Install Haxe and Hashlink: follow points 1, 2 and 5 of this Step-by-step tutorial from Sébastien Bénard
- Clone this git into a local repositories (or fork it then clone)
- Install required libs by running the following command in the root of the repo:
haxe setup.hxml
- Install Java (necessary for texture packing)
- Open the repo with vscode
- Press F1 (or Ctrl+Shift+P) then
Haxe: select configuration
and select build.dev.hxml - Run the task
Pack textures
or the scripttools/PackTexture.bat
- Press F5 to launch the game in debug or use the command bar buttons (see below)
- Install Haxe and Hashlink: follow points 1 and 2 of this Step-by-step tutorial from Sébastien Bénard
- Clone this git into a local repositories (or fork it then clone)
- Install required libs by running the following command in the root of the repo:
haxe setup.hxml
- Install Java (necessary for texture packing)
- Run the script
tools/PackTexture.bat
- Run the script
tools/RedistDebug.bat
to create an exe in the debug folder - Launch the exe in debug
From the command line, run either:
- For DirectX:
haxe build.directx.hxml
- For OpenGL:
haxe build.opengl.hxml
- For Javascript/WebGL:
haxe build.js.hxml
The build.dev.hxml
is just a shortcut to one of the previous ones, with added -debug
flag.
Run the result with either:
- For DirectX/OpenGL:
hl bin\client.hl
- For Javascript:
start run_js.html
- Install Butler as described here : https://itch.io/docs/butler/installing.html
- Add it to your path
- Execute the Redist task then the Butler or Steam one
- Visual Studio Code Command bar (id: gsppvo.vscode-commandbar) is recommended.
- gettext Language Support for Visual Studio Code (id: mrorz.language-gettext)
- After updating textures in the art folder, run the script
tools/PackTexture.sh
- Same for the music but with the script
tools/PackMusic.sh
- For artists, after fetching and pulling the last changes from the code, you can update the exe by running the script
tools/RedistDebug.sh
We use CastleDB for that. The file is res/Data.cdb
.
Execute haxe langParser.hxml
For localization support (ie. translating your game texts), you may also check the following guide.
We are using the UpperCamelCase for classes name. This means all worlds are next to each other without space and must start with an uppercase. Files and folders must be in lowerCamelCase (same but the first word has no starting uppercase) as well as variables and functions.
-
are used to differentiate file versions (eg. robot.png and robot-Blue.png or robot-Normal.png as well as robot-2.png).
_
are used to add tags or indicate a frame (eg. robot_walk_1.png is the first frame of the walk anim)
Often a dll issue. Check that you have all of them in the root directory.
Try compiling by hand (Run build task
in vscode or haxe hl.debug.hxml
command-line) then executing (hl bin/client.hl
in command-line).
Acquirable.hx:65: characters 7-20 : Null safety: Cannot return nullable value of Null<execute.T> as exe
Restart Language Server (F1
or Ctrl+Shift+P
)
https://heaps.io/documentation/text.html https://community.heaps.io/t/creating-bitmap-fonts-not-working-for-me/382/5
https://gist.github.com/Yanrishatum/ae3725a9e2b45e0766c065e573ed1f24
https://gist.github.com/Yanrishatum/d69ed72e368e35b18cbfca726d81279a
https://gist.github.com/Yanrishatum/6eb2f6de05fc951599d5afccfab8d0a9
https://github.com/HaxeFoundation/hashlink/wiki/Distribution-&--Packaging
- Use power of 2 sizes for textures
- For fast tile rendering, use h2d.TileGroup
- Have a lot of separate bitmaps? Combine them in one texture.
- For particle rendering, use h2d.SpriteBatch
- see https://heaps.io/documentation/drawing-tiles.html
- and https://heaps.io/documentation/resource-management.html
https://github.com/HaxeFoundation/hashlink/wiki/Profiler
- CastleDB for the game database
- Codecks for the project management
- LibGDX Texture Packer for packing texture
- Krita as an image editor
- binding for Dear ImGui
- Simple Haxe wrapper of Steam API for Hashlink
- Debug font from Heaps samples
- Music
The Temperature of the Air on the Bow of the Kaleetan
made by Chris Zabriskie (CC BY 4.0)