Giter Club home page Giter Club logo

onut's Introduction

#onut ##Oak Nut engine. 2D Game engine focused on rapid development. Aimed at Game Jams.

List of jam projects using it:

##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 there
    • assets\ Put game assets in here
      • ...
    • project\
      • win\ Windows configuration
        • YourGame.sln Your game solution
        • YourGame.vcxproj Your game project
        • YourGame.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

  1. Create a new empty win32 solution and project for your game.
  2. Clone onut inside your main directory. as shown in the Recommended folder structure
  3. Add onut project to your solution.
  • Right click your solution -> Add -> Existing project -> YourGamePath\onut\project\win\onut.vcxproj
  1. Add build dependancies for your game to include onut.
  • Right click YourGame project -> Build Dependencies -> Project Dependencies -> Check mark onut
  1. Add references to onut from your game.
  • Right click YourGame project -> Add -> References -> Add New Reference -> Check mark onut
  1. 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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.