4#include <raylib-cpp.hpp>
12using namespace std::string_literals;
16 std::shared_ptr<game::core::Actor> actor1 = std::make_unique<game::core::Actor>(std::make_unique<game::core::Sprite>(std::make_shared<game::core::Texture2D>(
"assets/graphics/ball.png"), 100, 100));
17 this->
actors.insert(std::make_pair(
"actor1", actor1));
19 std::shared_ptr<game::core::Actor> actor2 = std::make_unique<game::core::Actor>(std::make_unique<game::core::SpriteAnimated>(std::make_shared<game::core::Texture2D>(
"assets/graphics/anim_sprite.png"), 80.0f, 80.0f, 1, 3, 50, 100, 300));
20 this->
actors.insert(std::make_pair(
"actor2", actor2));
29 if (IsKeyPressed(KEY_ESCAPE))
36 DrawText(
"This is the game scene - press ESCAPE for pause", 10, 10, 30, LIGHTGRAY);
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 the...
void Update() override
The Update() method is used to process input and update the game state. It is called automatically be...
void Draw() override
The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn a...
static std::unique_ptr< game::core::Stage > stage
The Stage object is responsible for the scene change and for updating and drawing the scene contents.