A simple, cross-platform 2D game engine.
Go to file
Attila Uygun 571a21914c Fix typo 2023-07-29 00:47:18 +02:00
.vscode Fix for weapon position 2022-11-10 21:03:15 +01:00
assets Add option to switch between renderers 2023-06-04 12:54:40 +02:00
build Move AudioMixer::Resource to MixerInput 2023-07-13 10:49:42 +02:00
src Fix typo 2023-07-29 00:47:18 +02:00
.clang-format Remove OpenGL threaded rendering 2023-06-26 20:03:22 +02:00
.gitignore Update android build 2023-05-09 22:22:02 +02:00
LICENSE Initial commit. 2020-09-08 21:08:07 +02:00
README.md Add Engine::Print method 2023-07-28 18:37:51 +02:00
privacy.md Update. 2021-02-10 00:39:04 +01:00

README.md

A simple, cross-platform 2D game engine with OpenGL and Vulkan renderers. Supports Linux and Android platforms. This is a personal hobby project. I've published a little game on Google Play based on this engine. Full game code and assets are included in this repository.

Building the demo

Linux:

cd build/linux
make

Android:

cd build/android
./gradlew :app:assembleRelease

Third-party libraries:

glew, jsoncpp, minimp3, oboe, stb, texture-compressor, minizip, glslang, spirv-reflect, vma, vulkan-sdk, volk

Hello World example:

Simply shows a rotating "Hello Wolrd!".

#include "base/interpolation.h"
#include "engine/animator.h"
#include "engine/asset/image.h"
#include "engine/engine.h"
#include "engine/game.h"
#include "engine/game_factory.h"
#include "engine/image_quad.h"

class HelloWorld final : public eng::Game {
 public:
  ~HelloWorld() final = default;

  bool Initialize() final {
    eng::Engine::Get().SetImageSource(
        "hello_world_image",
        std::bind(&eng::Engine::Print, &eng::Engine::Get(), "Hello World!",
                  base::Vector4f(1, 1, 1, 0)));

    hello_world_.Create("hello_world_image");
    hello_world_.SetVisible(true);
    animator_.Attach(&hello_world_);
    animator_.SetRotation(base::PI2f, 3,
                          std::bind(base::SmootherStep, std::placeholders::_1));
    animator_.Play(eng::Animator::kRotation, true);
    return true;
  }

 private:
  eng::ImageQuad hello_world_;
  eng::Animator animator_;
};

DECLARE_GAME_BEGIN
DECLARE_GAME(HelloWorld)
DECLARE_GAME_END