raylibstarter 0.1.0
menu_scene.cpp
Go to the documentation of this file.
1#include <string>
2
3#include <raylib-cpp.hpp>
4#include <raylib.h>
5
6#include <store.h>
7
8#include "scenes.h"
9
10using namespace std::string_literals;
11
13 // Your scene initialization code here...
14}
15
17 // Your scene cleanup code here...
18}
19
21 // Your process input and update game scene code here...
22 if (IsKeyPressed(KEY_ENTER))
23 game::core::Store::stage->replaceWithNewScene("menu"s, "game"s, std::make_unique<GameScene>());
24}
25
27 // Your scene drawing code here...
28 // Note that scene-actors are drawn automatically
29 DrawText("Menu - press ENTER to load game scene", 10, 10, 30, LIGHTGRAY);
30}
void Draw() override
The Draw() method can be used to output graphics. Note that the elements of the actor map are drawn a...
Definition: menu_scene.cpp:26
void Update() override
The Update() method is used to process input and update the game state. It is called automatically be...
Definition: menu_scene.cpp:20
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.
Definition: store.h:16