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

Client side game: window, inputs, scenes and replication of the server world. More...

#include <game.hpp>

Public Member Functions

 Game ()
 Opens the 1280x720 window and creates the menu scene.
 
void onLoad (rtk::EngineContext &context)
 Registers components, loads blueprints, binds inputs, adds the systems and starts the network client.
 
bool shouldContinue () const
 Tells the engine whether to keep running.
 
void onUpdate (rtk::EngineContext &context, float dt)
 Applies network events and replication messages, then updates the active scene.
 
void onUnload (rtk::EngineContext &context)
 Destroys replicated entities, exits the scene and stops the network client.
 

Detailed Description

Client side game: window, inputs, scenes and replication of the server world.

Member Function Documentation

◆ onLoad()

void rtype::client::Game::onLoad ( rtk::EngineContext & context)

Registers components, loads blueprints, binds inputs, adds the systems and starts the network client.

Parameters
contextEngine services.

◆ shouldContinue()

bool rtype::client::Game::shouldContinue ( ) const

Tells the engine whether to keep running.

Returns
False once the window must close.

◆ onUpdate()

void rtype::client::Game::onUpdate ( rtk::EngineContext & context,
float dt )

Applies network events and replication messages, then updates the active scene.

Parameters
contextEngine services.
dtElapsed time since the last frame, in seconds.

◆ onUnload()

void rtype::client::Game::onUnload ( rtk::EngineContext & context)

Destroys replicated entities, exits the scene and stops the network client.

Parameters
contextEngine services.