R-Type 0.1
Loading...
Searching...
No Matches
rtype::client::GameScene Class Reference

In game scene, which shows the scrolling starfield. More...

#include <scene/gameScene.hpp>

Public Member Functions

 GameScene (rtk::RenderWindow &window)
 Creates the scene.
 
void onEnter (rtk::EngineContext &context)
 Creates the two parallax starfield layers.
 
std::optional< SceneType > onUpdate (rtk::EngineContext &context, const rtk::InputState &inputState, float dt)
 Does nothing, the game stays in this scene.
 
void onExit (rtk::EngineContext &context)
 Destroys the entities created by the scene.
 

Static Public Attributes

static constexpr SceneType Type = SceneType::Game
 Identifier of this scene.
 

Detailed Description

In game scene, which shows the scrolling starfield.

Constructor & Destructor Documentation

◆ GameScene()

rtype::client::GameScene::GameScene ( rtk::RenderWindow & window)
explicit

Creates the scene.

Parameters
windowWindow of the client.

Member Function Documentation

◆ onEnter()

void rtype::client::GameScene::onEnter ( rtk::EngineContext & context)

Creates the two parallax starfield layers.

Parameters
contextEngine services.

◆ onUpdate()

std::optional< SceneType > rtype::client::GameScene::onUpdate ( rtk::EngineContext & context,
const rtk::InputState & inputState,
float dt )

Does nothing, the game stays in this scene.

Parameters
contextEngine services.
inputStateInput state of the frame.
dtElapsed time since the last frame, in seconds.
Returns
The next scene, or std::nullopt to stay.

◆ onExit()

void rtype::client::GameScene::onExit ( rtk::EngineContext & context)

Destroys the entities created by the scene.

Parameters
contextEngine services.