Skip to content

Handcrank Engine is an easy-to-use game engine based on simple principles that are quick to understand and build with.

License

Notifications You must be signed in to change notification settings

HandcrankEngine/HandcrankEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This custom game engine is under early development and should not be used in production.

Handcrank Engine

Handcrank Engine is an easy-to-use game engine based on simple principles that are quick to understand and build with.

Made With SDL2 Build Lint Tests

Demo

handcrank-demo.mp4

Social

Platforms

Platform SDL Version Tested Stable
Windows 2.32.8
macOS 2.32.8
Web 2.32.8

Install

If you are on macOS, you can use brew to install.

$ brew tap handcrankengine/handcrankengine
$ brew install handcrankengine

Quick Start Guide

// documentation/Getting Started/QuickStart.cpp
#include "HandcrankEngine/HandcrankEngine.hpp"

using namespace HandcrankEngine;

auto game = std::make_unique<Game>();

auto main(int argc, char *argv[]) -> int
{
    game->SetTitle("Handcrank Engine");

    return game->Run();
}

Documentation

  1. Basics

    1. Animations
    2. Keyboard Input
    3. Mouse Input
    4. Update Loop
    5. Window
  2. Building

    1. macOS
    2. Windows
    3. Web
  3. RenderObjects

    1. Custom RenderObjects
    2. ImageRenderObject
    3. RectRenderObject
    4. SpriteRenderObject
    5. TextRenderObject
    6. VertexRenderObject
  4. Scenes

  5. Examples

    1. FPS
  6. Testing

    1. Valgrind

Getting Started

Draw Rectangle

// documentation/Getting Started/DrawRectangle.cpp
#include "HandcrankEngine/HandcrankEngine.hpp"
#include "HandcrankEngine/RectRenderObject.hpp"

using namespace HandcrankEngine;

auto game = std::make_unique<Game>();

auto main(int argc, char *argv[]) -> int
{
    game->SetTitle("Handcrank Engine");

    auto rect = std::make_shared<RectRenderObject>();

    rect->SetRect(0, 0, 250, 250);
    rect->SetFillColor(255, 0, 0, 255);

    game->AddChildObject(rect);

    return game->Run();
}

Draw Image

// documentation/Getting Started/DrawImage.cpp
#include "../images/sdl_logo.h"

#include "HandcrankEngine/HandcrankEngine.hpp"
#include "HandcrankEngine/ImageRenderObject.hpp"

using namespace HandcrankEngine;

auto game = std::make_unique<Game>();

auto main(int argc, char *argv[]) -> int
{
    game->SetTitle("Handcrank Engine");

    auto image = std::make_shared<ImageRenderObject>();

    image->LoadTexture(game->GetRenderer(), images_sdl_logo_png,
                         images_sdl_logo_png_len);

    game->AddChildObject(image);

    return game->Run();
}

Build

CMake (Recommended)

Note: Builds on Windows require Microsoft Visual C++ Redistributable to run.

Debug Build

mkdir build/
cd build/
cmake ..
cmake --build .

Release Build

Note: To generate DMG files on macOS, first build with cmake, then run cpack.

mkdir build/
cd build/
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release

g++

./bin/build.sh

Demos

Name Link Source Included?
Template https://github.com/HandcrankEngine/template
Pong Demo https://github.com/HandcrankEngine/pong-demo

Contributing

Be sure to review the Contributing Guidelines before logging an issue or making a pull request.

Community Roadmap

The goal of this project is to keep the features it offers to a minimum, allowing you, the developer, to forge your own path. If you have feature requests or bugs, please create an issue and tag them with the appropriate tag. If an issue already exists, vote for it with 👍.

License

The MIT License (MIT)

About

Handcrank Engine is an easy-to-use game engine based on simple principles that are quick to understand and build with.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published