Welcome to Sprite Engine, a user-friendly 2D Game Engine designed for solo developers who want a straightforward yet powerful tool.
- SFML
- Dear ImGui
- CMake
- Rene
- 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
- Sound Manager
- Additional C++ Functions
- Cleaner Design
- Box Collider Rotation
- 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!!!
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.
-
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
orCTRL + B
in the engine will automatically build the project so you can execute it directly in the editor. - Click the
-
How Do I Script My Sprites?
The engine calls the
update
andstart
methods of theGame
class. If you create a new script, you need to invoke theupdate
method from the script within theGame
class. If you wish to share instances, simply pass them in theupdate
methods or set a pointer to them in thestart
method. To access a sprite, callthis->config.ptr_sprites->GetByName("name");
This method returns a pointer to the sprite in theSpriteRepository
. 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)) } }
- 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; }
-
This game is currently being developed, github link: DasynceSE