Commonly called "onut". Game engine focused on rapid development. Aimed at Game Jams.
var texture = getTexture("image.png");
function render() {
// Begin a batch
SpriteBatch.begin();
// Draw a sprite at screen coordinates x=200, y=100 from top left corner.
SpriteBatch.drawSprite(texture, new Vector2(200, 100));
// End and flush the batch
SpriteBatch.end();
}
function update(dt) {
spriteAngle += dt * 45; // Will rotate 45 degree per second
}
function render() {
...
// Draw a sprite at with an animated angle
SpriteBatch.drawSprite(texture, new Vector2(200, 100), Color.WHITE, spriteAngle);
...
}
See onut/samplesJS/
folders for more detailed samples.
-
Global Game Jam 2018 - Messenger Hacker
-
Ottawa Game Jam 2017 - Sheep Dog Heroes
-
Linux Game Jam 2017 - Retro Game War
-
Ottawa Game Jam 2016 - Spy Satellite Showdown
-
Global Game Jam 2016 - Fire Whisperers
-
Ottawa Game Jam 2015 - Cannon Fodder Commander
- Onut 5.0 - The 3D release - TBD
- Onut 4.0 - The Multiplayer release - TBD
- Onut 3.0 - The JavaScript release - Jul 14, 2017
- Onut 2.0 - The Cleanup release - Apr 3, 2016
- Onut 1.0 - Feb 6, 2016
- Clone onut somewhere on your PC.
- Generate using cmake.
- Build the JSStandAlone project in release.
- Copy the executable to your game's folder.
Recommended to use Visual Studio Code.
- Create a folder for your game somehere on your PC
- Copy
[onut path]/jsconfig.json
,[onut path]/typings/onut.d.ts
to YourGame path. - Create a
settings.txt
file. Refer to samples to see what can be put in there. - Create assets and javascript files
main.js
will always be the last JavaScript file executed, use it to initialize stuff.
function update(dt) {
// Update your game here
}
function render() {
}
Before you start. Please take note of the following folder structure. It is highly recommended for minimal setup time.
The default asset search paths are configured for this structure. But it easy to add more using oContentManager->addSearchPath
.
YourGame\
assets\
Put game assets in here- ...
src\
Your game source code (.h and .cpp)- .. projects files or your CMakeLists.txt
Make sure to define those 6 functions. Otherwise you will get unresolved errors.
void initSettings()
{
}
void init()
{
}
void update()
{
}
void render()
{
}
void postRender()
{
}
void renderUI()
{
}
Look at samples to see what can be done here.
Here is a table of features with support per platform and availability to the javascript bindings. For a full list of features, check the samples/ and samplesJS/.
Feature | Windows | OS X | Linux | Javascript Bindings |
---|---|---|---|---|
Anims | ✓ | ✓ | ✓ | ✓ |
Audio Stream | ✓ | ✓ | ✓ | unplanned |
Base64 | ✓ | ✓ | ✓ | ✓ |
Bitmap Fonts | ✓ | ✓ | ✓ | ✓ |
Box2D | ✓ | ✓ | ✓ | |
Cloud | disabled | |||
CMake | ✓ | ✓ | ✓ | n/a |
CSV | ✓ | ✓ | ✓ | |
Effects | ✓ | ✓ | ✓ | ✓ |
Entity/Components | ✓ | ✓ | ✓ | |
File Dialogs | ✓ | unplanned | ||
File IO | ✓ | ✓ | ✓ | ✓ |
File utils | ✓ | unplanned | ||
Game Pads | ✓ | ✓ | ✓ | ✓ |
Hash | ✓ | ✓ | ✓ | ✓ |
Http | ✓ | ✓ | ✓ | ✓ |
Images | ✓ | ✓ | ✓ | unplanned |
Keyboard | ✓ | ✓ | ✓ | ✓ |
Log | ✓ | ✓ | ✓ | ✓ |
Maths | ✓ | ✓ | ✓ | ✓ |
Mouse | ✓ | ✓ | ✓ | ✓ |
Multiplayer | ||||
Music | ✓ | ✓ | ✓ | ✓ |
Native Cursor | ✓ | ✓ | ✓ | ✓ |
Path Finding | ✓ | ✓ | ✓ | ✓ |
Particles | ✓ | ✓ | ✓ | ✓ |
PrimitiveBatch | ✓ | ✓ | ✓ | ✓ |
Random | ✓ | ✓ | ✓ | ✓ |
Renderer | ✓ | ✓ | ✓ | ✓ |
Settings | ✓ | ✓ | ✓ | partial |
Sha1 | ✓ | ✓ | ✓ | ✓ |
Shaders | ✓ | ✓ | ✓ | ✓ |
Sounds | ✓ | ✓ | ✓ | ✓ |
Sprite Anims | ✓ | ✓ | ✓ | ✓ |
SpriteBatch | ✓ | ✓ | ✓ | ✓ |
System Info | n/a | n/a | n/a | ✓ |
TCP Sockets | ✓ | ✓ | ✓ | |
Textures | ✓ | ✓ | ✓ | ✓ |
TiledMaps | ✓ | ✓ | ✓ | ✓ |
Thread Pool | ✓ | ✓ | ✓ | n/a |
UI | ✓ | ✓ | ✓ | partial |
Vertex Buffers | ✓ | ✓ | ✓ | ✓ |
Video Player | ✓ | ✓ |
Logo design by Pixilabs Software Inc.