An intuitive and beginner friendly 2D game framework for C++
Features • How to build • Get Started • Screenshots • Showcase • Support
NasNas is a lightweight cross platform modular 2D game framework.
It is entirely written in modern C++17, and uses SFML2 for rendering.
It provides a clean and easy to use API.
The framework is separated in multiple modules :
Core | Ecs | Reslib | Tilemapping | Tween | Ui | |
---|---|---|---|---|---|---|
Windows | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Linux | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
MacOS | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Android | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
iOS | :question: | :question: | :question: | :question: | :question: | :question: |
You can find a global roadmap for the version 1.0 on the project board
Clone the repository.
git clone https://github.com/Madour/NasNas
cd NasNas
Then, you can build the static libraries with :
mkdir build && cd build
cmake ..
cmake --build . -j4
Finally, you can install those libraries using :
cmake --install .
To build the framework for Android, please refer to the Android example's readme
-DNASNAS_BUILD_ECS=OFF
to disable the ECS module
-DNASNAS_BUILD_RESLIB=OFF
to disable the Reslib module
-DNASNAS_BUILD_TILEMAPPING=OFF
to disable the Tilemapping module
-DNASNAS_BUILD_TWEEN=OFF
to disable the Tween module
-DNASNAS_BUILD_UI=OFF
to disable the UI module
-DNASNAS_EXAMPLES=ON
to create the example applications targets
-DNASNAS_BUILD_SFML=ON
to download and build SFML inside the project (enabled automatically if SFML package is not found)
-DNASNAS_STATIC_VCRT=ON
to link the Visual C++ runtime statically (/MT) when using the Microsoft Visual C++ compiler
Here is a sample code using NasNas framework, this will create a 720x480 window and log a string to the console :
#include <NasNas/Core.hpp>
class Game : public ns::App {
public:
Game() : ns::App("My game", 720, 480) {
ns_LOG("Created a NasNas app !");
}
void onEvent(const sf::Event& event) override {
if (event.type == sf::Event::Closed)
getWindow().close();
}
void update() override {}
};
int main() {
Game g;
g.run();
return 0;
}
An introduction tutorial to learn how to use the framework can be found on the wiki.
Documentation can be found here.
You can also check examples source code for a small overview of what you can do with the framework.
All of these programs source code can be found in the examples
folder.
The following games were created with NasNas :
If you like the project, please consider starring this repository.
If you would like to discuss anything about the project, feel free to open a new discussion.