nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::DeathScreen Class Reference

#include <death_screen.h>

Public Member Functions

void Update (float seconds, bool dead)
 Moves on by the frame's time, from whether the player's dead.
float dark () const
 How dark the world is, from 0 to 1.
bool Build (bool dead, uint32_t wait_ms) const

Static Public Attributes

static constexpr float kDim = 0.6f
 How dark the world gets while they're dead, from 0 to 1.
static constexpr float kDarken = 1.0f
 In seconds: how long the world takes to darken, and to come back.
static constexpr float kReturn = 0.8f

Detailed Description

What the player sees while they're dead: the world darkens, and a window in the middle counts down to when they can come back, then lets them, with a click. As they come back, in the middle of the land, the screen goes dark and the world fades back in, so that they don't jump there.

Definition at line 12 of file death_screen.h.

Member Function Documentation

◆ Build()

bool nanommo::DeathScreen::Build ( bool dead,
uint32_t wait_ms ) const

Darkens the world, and while the player's dead, draws the window, with how long they have to wait, in milliseconds. Returns true once they ask to come back.

Definition at line 37 of file death_screen.cc.

◆ dark()

float nanommo::DeathScreen::dark ( ) const
inline

How dark the world is, from 0 to 1.

Definition at line 24 of file death_screen.h.

◆ Update()

void nanommo::DeathScreen::Update ( float seconds,
bool dead )

Moves on by the frame's time, from whether the player's dead.

Definition at line 24 of file death_screen.cc.

Member Data Documentation

◆ kDarken

float nanommo::DeathScreen::kDarken = 1.0f
staticconstexpr

In seconds: how long the world takes to darken, and to come back.

Definition at line 17 of file death_screen.h.

◆ kDim

float nanommo::DeathScreen::kDim = 0.6f
staticconstexpr

How dark the world gets while they're dead, from 0 to 1.

Definition at line 15 of file death_screen.h.

◆ kReturn

float nanommo::DeathScreen::kReturn = 0.8f
staticconstexpr

Definition at line 18 of file death_screen.h.


The documentation for this class was generated from the following files: