This is a simple game engine project. Currently, it supports creating game objects, rendering them, changing their position, scale, rotation, adding colliders and handling collisions
- Game Objects: Create and manage game objects.
- Rendering: Render game objects on the screen.
- Transformations: Change the position, scale, and rotation of game objects.
- Colliders: Add colliders to game objects for collision detection.
- Collision Manager: Manage and detect collisions between game objects.
- QuadTree space partitioning: QuadTree data structure used to optimize collision detection
- Game view: switch between game view and editor view, move around scene editor using W A S D, zoom in and out with Q E
- C++ compiler
- CMake
- SFML
- ImGui
- ImGui-SFML
- ImGuiFileDialog
- Catch2 v.3 for tests
-
Clone the repository:
git clone https://github.com/MichalSzandar/TurtleEngine.git cd game_engine -
Create a build directory and navigate to it:
mkdir build cd build -
Run CMake to configure the project:
cmake ..
-
Build the project:
make
After building the project, you can run the executable:
./GameEngineto run tests
./testsYou can create game objects and add components such as transforms and box colliders. Here's an example of how to create a game object and add components:
GameObject obj("Player");
obj.addComponent<Transform>(100.0f, 200.0f);
obj.addComponent<SpriteRenderer>();
obj.addComponent<BoxCollider>(100.0f, 200.0f, 50.0f, 50.0f);The game engine automatically renders all game objects added to the current scene.
Transform* transform = obj.findComponent<Transform>();
transform->setPosition(sf::Vector2f(150.0f, 250.0f));obj.addComponent<BoxCollider>(100.0f, 200.0f, 50.0f, 50.0f);