The Hengine is a JavaScript game engine for both small scale creative coding projects and larger scale games.
The Hengine doesn't need to be installed. However, if you want to run code with a local copy of the Hengine (to preserve compatibility), simply clone this repository.
git clone "https://www.github.com/Elkwizard/Hengine"
Before using the Hengine, it must be included in your HTML file in one of two possible ways.
-
Including a script tag pointing to
Hengine/Package/Engine/Manage/HengineLoader.js
, and linking to an external main JavaScript file.app.html: <html> <head> <script src="https://elkwizard.github.io/Hengine/Package/Engine/Manage/HengineLoader.js"></script> </head> <body> <script> // Load Hengine, user's main JavaScript file is index.js in this example. HengineLoader.load([ new HengineScriptResource("index.js") ]); </script> </body> </html>
index.js: // Hengine hello world renderer.textMode = TextMode.CENTER_CENTER; // Text will be drawn relative to its center intervals.continuous(() => { renderer.draw(Color.BLACK).text(Font.Arial50, "Hello World!", middle); // Draw "Hello World" to the middle of the screen });
-
Including a script tag pointing to
Hengine/Hengine.js
with the main JavaScript code embedded within.compactApp.html: <script src="https://elkwizard.github.io/Hengine/Hengine.js"> // Hengine hello world renderer.textMode = TextMode.CENTER_CENTER; // Text will be drawn relative to its center intervals.continuous(() => { renderer.draw(Color.BLACK).text(Font.Arial50, "Hello World!", middle); // Draw "Hello World" to the middle of the screen }); </script>
The documentation for the Hengine can be found here.