|
supertux
|
Screen that runs a Level, where Players run and jump through Sectors. More...
#include <game_session.hpp>
Public Member Functions | |
| GameSession (const std::string &levelfile, Savegame &savegame, Statistics *statistics=nullptr) | |
| virtual void | draw (Compositor &compositor) override |
| gets called once per frame. More... | |
| virtual void | update (float dt_sec, const Controller &controller) override |
| gets called for once (per logical) frame. More... | |
| virtual void | setup () override |
| gets called before this screen gets activated (which is at least once before the first draw or update call | |
| virtual void | leave () override |
| gets called when the current screen is temporarily suspended | |
| void | finish (bool win=true) |
| ends the current level | |
| void | respawn (const std::string §orname, const std::string &spawnpointname, const bool invincibility=false, const int invincibilityperiod=0) |
| void | reset_level () |
| void | set_reset_point (const std::string §orname, const Vector &pos) |
| std::string | get_reset_point_sectorname () const |
| Vector | get_reset_point_pos () const |
| Sector & | get_current_sector () const |
| Level & | get_current_level () const |
| void | start_sequence (Sequence seq, const SequenceData *data=nullptr) |
| std::string | get_working_directory () const |
| returns the "working directory" usually this is the directory where the currently played level resides. More... | |
| int | restart_level (bool after_death=false) |
| void | toggle_pause () |
| void | abort_level () |
| bool | is_active () const |
| void | set_editmode (bool edit_mode=true) |
| Enters or leaves level editor mode. | |
| void | force_ghost_mode () |
| Forces all Players to enter ghost mode. | |
| Savegame & | get_savegame () const |
Public Member Functions inherited from GameSessionRecorder | |
| void | start_recording () |
| void | record_demo (const std::string &filename) |
| int | get_demo_random_seed (const std::string &filename) const |
| void | play_demo (const std::string &filename) |
| void | process_events () |
| void | reset_demo_controller () |
| Re-sets the demo controller in case the sector (and thus the Player instance) changes. More... | |
| bool | is_playing_demo () const |
Public Attributes | |
| bool | reset_button |
| bool | reset_checkpoint_button |
Additional Inherited Members | |
Static Public Member Functions inherited from Currenton< GameSession > | |
| static GameSession * | current () |
|
overridevirtual |
gets called once per frame.
The screen should draw itself in this function. State changes should not be done in this function, but rather in update
Implements Screen.
| std::string GameSession::get_working_directory | ( | ) | const |
returns the "working directory" usually this is the directory where the currently played level resides.
This is used when locating additional resources for the current level/world
|
overridevirtual |
gets called for once (per logical) frame.
Screens should do their state updates and logic here
Implements Screen.
1.8.12