Simple Arduboy Scene Management Framework
- Clone / Fork the project
- Install from Python official website
https://www.python.org/downloads
- From your Terminal / Command Prompt, go to
ArduEngine
project and run this command below. (Note that your project name must be Alphanumeric only and without space)
python ./main.py [Your Project Name]
- Your project will be created under
/Projects
directory and your terminal will be showingArduEngine
Window
This tool manages your scenes and removes boilerplate while creating a new scene for yor game.
- List of your scenes
- Press 1 if you want to create a new scene
- Press 2 if you want to remove a scene
- Rebuild the SceneManager from your available scenes.
Your scenes will be located under [Your Project]/Scenes
. SceneManager
will read this folder and generate a code that contains every scene id and initializing your scenes.
Because of this, it's not recommended to edit SceneManager
manually, unless you know what you're doing.
- Press 1 on
ArduEngine
Window. - Enter your scene name (Must be Alphanumeric and no space) then press enter.
- Your new scene will be created under the
/Scenes
folder andSceneManager
will be updated.
- Press 2 on Arduengine Window.
- Enter your scene name that you want to remove.
- Your scene will be moved to /Scenes/Backups directory and your SceneManager will be updated.
It's recommended to create and remove scene from the ArduEngine
Window instead of doing it manually. If somehow you create a new scene manually, you have to put your scene under the /Scenes
folder, then you can rebuild the SceneManager
from the window.
Every scenes inside the /Backups
folder are safe to delete.
/YourProjectName
/ArduEngine # ArduEngine Library
/Scenes # All of your scenes are located here
ArduEngine.py # This is an ArduEngine Window Script. Open ArduEngine Window with this command "python ./ArduEngine.py"
Images.h # Put all of your images here
SceneManager.cpp
YourProjectName.ino # Your main code
To set the first scene to be shown when the game is turned on, go to your YourProjectName.ino
file, and look inside the setup()
method. You will find arduEngine->SetScene(SPLASH_SCREEN_SCENE_ID);
. After you create some other scenes, change the SPLASH_SCREEN_SCENE_ID
into your scene ID defined inside the SceneManager.cpp
.
To change the scene from your scene, once you have the &arduEngine
object, you can use arduEngine.SetScene(YOUR_SCENE_ID)
to change into a different scene.