-
Notifications
You must be signed in to change notification settings - Fork 1
Quick Start
When it comes to Haxe projects, VSCode is almost always the preferred IDE.
One also needs to install a few extensions:
- vshaxe
- Live Server (highly recommended, used to test client locally)
- Better Comments (highly recommended - special comments are used throughout the codebase)
- vscode-icons (optional)
The latest version can be found here.
This is a virtual machine for Haxe, which can be downloaded here. While the client's target is HTML5, the server targets HashLink.
To do this, simply execute the following:
haxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib git haxeui-html5 https://github.com/haxeui/haxeui-html5 --never
haxelib install howlerjs
haxelib git polygonal-ds https://github.com/polygonal/ds
haxelib install format
haxelib install haxe-strings
haxelib install lzstring
haxelib git argparse https://github.com/MattTuttle/argparse
haxelib git hxWebSockets https://github.com/ianharrigan/hxWebSockets
haxelib git yaml https://github.com/Gulvan0/hx-yaml
haxelib git hscript_template https://github.com/filt3rek/hscript-templateIt is assumed that Git is already installed. GitHub Desktop is also a convenient app, but having it isn't mandatory.
Both client-side and server-side repo should be cloned.
Since both frontend and backend are written in Haxe, they share some common code. Making a separate haxelib for it was considered an overkill, so, for that purpose, junction is being used. Basically, server-side net.shared package points to a client-side net.shared package.
To create such junction, execute the following:
mklink /J "<path to local server-side repo root>/src/net/shared" "<path to local client-side repo root>/src/net/shared"In the local clone of the client-side repo, create file build/html5/config.yaml with the following contents:
host: localhost
port: 5000
secure: false
keep-alive-beat-interval-ms: 2500
keep-alive-timeout-ms: 10000
min-server-build: 1676305984Analogically, in the local clone of the server-side repo, create hl/config.yaml:
host: localhost
port: 5000
keep-alive:
beat-interval-ms: 2500
timeout-ms: 10000
min-client-build: 1676305984
elo:
default: 1200
max-logslope: 7.0
normal-logslope: 4.0
calibration-games: 12
rules:
secs-added-manually: 15You can learn more about the parameters of both configs (there are actually more of them) in the respective section.
After that, you're ready to go!
Client-side code can be compiled by executing the batch file located in the repository root:
./build.batThis is also possible (and works on MacOS/Linux), but may require cache cleanup:
haxe html5.hxmlTo test the result, open the build\html5\index.html page with the Live Server. You can edit the host, port and secure parameters to switch between connecting to a prod and a local server.
Server-side code can be compiled simply by using this command:
haxe build.hxmlAfter that, the server may be launched like this:
hl hl/app.hl -i -d -l