Skip to content
/ A2D Public
forked from ayles/A2D

Small cross-platform 2D game engine.

License

Notifications You must be signed in to change notification settings

brucelevis/A2D

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A2D

Small cross-platform 2D game engine.

Build status Build Status CodeFactor

Getting started (Build & Run)

To start simple project follow these steps:

  1. Clone repo

    git clone https://github.com/ayles/A2D.git
    
  2. Use generate.py to generate project files:

    python3 A2D/tools/generate.py MySimpleProject -d .
    
  3. Optionally edit MySimpleProject/src/root_component.hpp

  4. Build desktop project:

    cd MySimpleProject/projects/proj.desktop
    mkdir build
    cd build
    cmake ..
    cmake --build .
    
  5. Run:

    ./MySimpleProject
    

Supported platforms

  • Windows (MSVC)
  • Linux
  • macOS
  • Android
  • iOS

Sample

// root_component.hpp

namespace a2d {

class RootComponent : public Component {
public:
    intrusive_ptr<Object2D> text;
    intrusive_ptr<Camera> camera;

    void Initialize() override {
        camera = Object2D::Create()->AddComponent<Camera>();
        Renderer::SetMainCamera(camera);

        text = Object2D::Create();
        text->AddComponent<Text>()->SetFont(Resources::Get<BitmapFont>("impact"));
        text->GetComponent<Text>()->SetOrigin(0.5f, 0.0f);
        text->GetComponent<Text>()->SetFontSize(24);
        text->GetComponent<Text>()->SetText(U"Hello, A2D!");
    }

    void Update() override {
        text->SetRotation(text->GetRotation() + Engine::GetDeltaTime());
        camera->SetHeight(Renderer::GetHeight());
    }
};

}

Future plans

  • Rework audio
  • Add support for texture atlas creation on-the-fly
  • Add Emscripten support
  • And more...

Contact & Contribute

This project is small, so all contributions are welcome.

You can contact with me by email selya.main@gmail.com.

About

Small cross-platform 2D game engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.0%
  • CMake 8.1%
  • Java 1.9%
  • Swift 1.3%
  • GLSL 0.7%
  • Python 0.6%
  • Other 0.4%