#onut ##Oak Nut engine. 2D Game engine focused on rapid development. Aimed at Game Jams.
List of jam projects using it:
- Ottawa Game Jam 2015 - Cannon Fodder Commander
- Global Game Jam 2016 - Fire Whisperers
- Ottawa Game Jam 2016 - Spy Satellite Showdown
##Prerequisites
- Windows 8.1 or higher
- Visual Studio 2013 for windows Desktop (Express or Community)
##Recommended folder structure 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
.
YourGamePath\
onut\
Clone onut thereassets\
Put game assets in here- ...
project\
win\
Windows configurationYourGame.sln
Your game solutionYourGame.vcxproj
Your game projectYourGame.vcxproj.filters
src\
Your game source code (.h and .cpp)
##Setup project Make sure to follow the recommended folder structure when doing those steps.
###Step by step
- Create a new empty win32 solution and project for your game.
- Clone onut inside your main directory. as shown in the
Recommended folder structure
- Add onut project to your solution.
- Right click your solution -> Add -> Existing project ->
YourGamePath\onut\project\win\onut.vcxproj
- Add build dependancies for your game to include
onut
.
- Right click YourGame project -> Build Dependencies -> Project Dependencies -> Check mark
onut
- Add references to
onut
from your game.
- Right click YourGame project -> Add -> References -> Add New Reference -> Check mark
onut
- Add include path to onut
- Right click YourGame project -> Properties -> Configuration Properties -> C/C++ -> General -> Additional Include Directories. Add the following
../../src
../../onut/include
##Main (C++ Game)
// Required for WinMain
#include <Windows.h>
// Oak Nut include
#include <onut/onut.h>
// Main
int CALLBACK WinMain(HINSTANCE appInstance, HINSTANCE prevInstance, LPSTR cmdLine, int cmdCount)
{
// Run.
// Define your own init(), update(), render() calls and pass them as parameters.
onut::run(init, update, render);
}
##Main (JavaScript Game)
###C++
// Required for WinMain
#include <Windows.h>
// Oak Nut include
#include <onut/onut.h>
// Main
int CALLBACK WinMain(HINSTANCE appInstance, HINSTANCE prevInstance, LPSTR cmdLine, int cmdCount)
{
// Run.
onut::run();
}
###JS
// Init here
function update(dt) {
// Update your game here
}
function render() {
// Draw your game here
}
##Samples
See the onut/samples/Samples.sln
and onut/samplesJS/Samples.sln
folders to learn how to use onut.
Enjoy!