Skip to content

This Project is a simple 2D Game Engine designed to be fully understand by one Person.

License

Notifications You must be signed in to change notification settings

jkatsanis/SpriteEngineUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RUN THE RUNME.sh FILE!!!

Welcome To Sprite Engine

Welcome to Sprite Engine, a user-friendly 2D Game Engine designed for solo developers who want a straightforward yet powerful tool.

Table of Contents

  1. Welcome To Sprite Engine
  2. Tools Used
  3. Features
  4. Enhancements
  5. Quick overview
  6. Getting Started
  7. The Engine

Tools Used

  • SFML
  • Dear ImGui
  • CMake
  • Rene

Features

  • UI Editor
  • Scene Creation
  • Box Collision Detection
  • Parent-Child Collision Stopping
  • Physics
  • Animations (supported by the editor)
  • Scripting with C++
  • Project Creator
  • Automatic Project Builder
  • Lighting
  • Prefabs
  • Simulation in editor

Enhancements

  • Sound Manager
  • Additional C++ Functions
  • Cleaner Design
  • Box Collider Rotation

How to build

  • MAKE SURE TO RUN THE RUNME.sh file
  • This will create a Build folder, run cmake and build the C++ files.
  • It creates also a special Build folder in Engine/Template/ so the engine does not crash when creating a new project, the Engine/Template/Build directory is REQUIRED!!!

Getting Started

Note: This file may be outdated as I am working solo on this engine.

To begin, clone this github repository.

(Outdated) Watch an introduction to the engine on YouTube.

  1. Create a Project

    • Click the create button to initiate a new project.
    • In the file dialog, choose the project location and press the + button.
    • All files from the template folder will be copied to the selected project location.
    • I suggest opening the user project that got generated

    Tip: Pressing build or CTRL + B in the engine will automatically build the project so you can execute it directly in the editor.

  2. How Do I Script My Sprites?

    The engine calls the update and start methods of the Game class. If you create a new script, you need to invoke the update method from the script within the Game class. If you wish to share instances, simply pass them in the update methods or set a pointer to them in the start method. To access a sprite, call this->config.ptr_sprites->GetByName("name"); This method returns a pointer to the sprite in the SpriteRepository. You can now perform various operations with the sprite. Please be aware that the engine still has many bugs.

  • Open the project that got generated by the editor.

  • Right-click the hierarchy window and select New -> Sprite.

  • In the game engine, right-click on the asset folder and choose New -> C++ Script to create a script with update and start functions.

  • Create a new Sprite ptr in your class:

    class Game : public spe::IScript
    {
    private:
        Sprite* m_sprite;
    }
  • Assign an address to the Sprite ptr using:

    void Game::start()
    {
        this->m_sprite = this->configptr_sprites->getSpriteWithName("name");
    }
  • Change sprite properties in the update function:

    void Game::update()
    {
        if(Input::onKeyHold(KeyBoardCode::A))
        {
            this->m_sprite.transform.setPosition(spe::Vector(x, y))
        }
    }
  1. How do the sprites get managed?
    • All sprites are managed by an object called SpriteRepository.

    • Add sprites to the scene using the repository:

      void Game::start()
      {
          Sprite* spr = new Sprite();
          this->config.ptr_sprites.add(spr);
      }
    • Activate necessary components for basic collision detection:

      void Game::start()
      {
          Sprite* spr = new Sprite();
          spr->collider.exist = true;
      }

The Engine

Picture of the Engine Engine

This game is currently being developed, github link: DasynceSE

How does the SpriteRepository work? SpriteRepository

About

This Project is a simple 2D Game Engine designed to be fully understand by one Person.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages