|
raylibstarter 0.1.0
|
Scene base class. Scenes are managed by the Stage object. More...
#include <scene.h>
Public Member Functions | |
| Scene () | |
| virtual | ~Scene () |
| virtual void | Update ()=0 |
| The Update() method is used to process input and update the game state. It is called automatically before Draw() is called. More... | |
| virtual void | Draw ()=0 |
| The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn automatically. More... | |
Public Attributes | |
| std::map< std::string, std::shared_ptr< game::core::Actor > > | actors = { } |
| Actors of the scene. The Actor objects of this map are drawn automatically by the Stage object if their visibility attribute is true. More... | |
Scene base class. Scenes are managed by the Stage object.
Scenes are one basic element of this engine. They contain the actual game-play elements. Scene classes derived from this base class implement an Update() method to manipulate the game state and draw graphics via the Draw() method to be implemented.
A scene object contains actors that are automatically drawn by the Stage object. Actor objects can be placed in the actor-map of a scene object and will be drawn automatically if their visible attribute is true. If actor objects are supposed to be available across scenes, they can also be stored in game::core::actors. Objects that are only referenced there will not be drawn automatically.
|
pure virtual |
The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn automatically.
Implemented in game::scenes::GameScene, game::scenes::MenuScene, and game::scenes::PauseScene.
|
pure virtual |
The Update() method is used to process input and update the game state. It is called automatically before Draw() is called.
Implemented in game::scenes::GameScene, game::scenes::MenuScene, and game::scenes::PauseScene.
| std::map<std::string, std::shared_ptr<game::core::Actor> > game::core::Scene::actors = { } |