Skip to content

MichalSzandar/TurtleEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Engine

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

Features

  • 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

Getting Started

Prerequisites

  • C++ compiler
  • CMake
  • SFML
  • ImGui
  • ImGui-SFML
  • ImGuiFileDialog
  • Catch2 v.3 for tests

Building the Project

  1. Clone the repository:

    git clone https://github.com/MichalSzandar/TurtleEngine.git
    cd game_engine
  2. Create a build directory and navigate to it:

    mkdir build
    cd build
  3. Run CMake to configure the project:

    cmake ..
  4. Build the project:

    make

Running the Project

After building the project, you can run the executable:

./GameEngine

to run tests

./tests

Usage

Creating game objects

You 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);

Rendering Game Objects

The game engine automatically renders all game objects added to the current scene.

Changing position

Transform* transform = obj.findComponent<Transform>();
transform->setPosition(sf::Vector2f(150.0f, 250.0f));

Adding Box Collider

obj.addComponent<BoxCollider>(100.0f, 200.0f, 50.0f, 50.0f);

About

game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors