17 #ifndef HEADER_SUPERTUX_SUPERTUX_GAME_SESSION_HPP 18 #define HEADER_SUPERTUX_SUPERTUX_GAME_SESSION_HPP 24 #include "math/vector.hpp" 25 #include "supertux/game_session_recorder.hpp" 26 #include "supertux/player_status.hpp" 27 #include "supertux/screen.hpp" 28 #include "supertux/sequence.hpp" 29 #include "util/currenton.hpp" 30 #include "video/surface_ptr.hpp" 50 virtual void setup()
override;
51 virtual void leave()
override;
54 void finish(
bool win =
true);
55 void respawn(
const std::string& sectorname,
const std::string& spawnpointname,
56 const bool invincibility =
false,
const int invincibilityperiod = 0);
58 void set_reset_point(
const std::string& sectorname,
const Vector& pos);
59 std::string get_reset_point_sectorname()
const {
return m_reset_sector; }
61 Vector get_reset_point_pos()
const {
return m_reset_pos; }
62 Sector& get_current_sector()
const {
return *m_currentsector; }
63 Level& get_current_level()
const {
return *m_level; }
65 void start_sequence(Sequence seq,
const SequenceData* data =
nullptr);
73 int restart_level(
bool after_death =
false);
75 bool reset_checkpoint_button;
79 bool is_active()
const;
87 Savegame& get_savegame()
const {
return m_savegame; }
90 void check_end_conditions();
95 void on_escape_press();
98 std::unique_ptr<Level> m_level;
99 std::unique_ptr<Level> m_old_level;
100 SurfacePtr m_statistics_backdrop;
103 typedef std::vector<HSQOBJECT> ScriptList;
104 ScriptList m_scripts;
111 float m_speed_before_pause;
113 std::string m_levelfile;
116 std::string m_reset_sector;
120 std::string m_newsector;
121 std::string m_newspawnpoint;
124 bool m_pastinvincibility;
125 int m_newinvincibilityperiod;
133 bool m_levelintro_shown;
135 int m_coins_at_start;
136 BonusType m_bonus_at_start;
137 int m_max_fire_bullets_at_start;
138 int m_max_ice_bullets_at_start;
142 bool m_end_seq_started;
Definition: controller.hpp:56
void finish(bool win=true)
ends the current level
Definition: game_session.cpp:418
Abstract base class for code the MainLoop runs exclusively and full-screen.
Definition: screen.hpp:29
Simple two dimensional vector.
Definition: vector.hpp:24
virtual void update(float dt_sec, const Controller &controller) override
gets called for once (per logical) frame.
Definition: game_session.cpp:296
void set_editmode(bool edit_mode=true)
Enters or leaves level editor mode.
Definition: game_session.cpp:210
Definition: sequence.hpp:33
This class is a layer between level and worldmap to keep track of stuff like scores, and minor, but funny things, like number of jumps and stuff.
Definition: statistics.hpp:32
std::string get_working_directory() const
returns the "working directory" usually this is the directory where the currently played level reside...
Definition: game_session.cpp:464
Represents one of (potentially) multiple, separate parts of a Level.
Definition: sector.hpp:49
Definition: game_session_recorder.hpp:25
Definition: endsequence.hpp:23
virtual void draw(Compositor &compositor) override
gets called once per frame.
Definition: game_session.cpp:249
virtual void setup() override
gets called before this screen gets activated (which is at least once before the first draw or update...
Definition: game_session.cpp:270
A 'Currenton' allows access to the currently active instance of a class via the static current() func...
Definition: currenton.hpp:30
Represents a collection of Sectors running in a single GameSession.
Definition: level.hpp:29
virtual void leave() override
gets called when the current screen is temporarily suspended
Definition: game_session.cpp:291
Definition: compositor.hpp:29
Definition: savegame.hpp:66
This is a dummy controller that doesn't react to any user input but should be controlled by code...
Definition: codecontroller.hpp:24
void force_ghost_mode()
Forces all Players to enter ghost mode.
Definition: game_session.cpp:230
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
Screen that runs a Level, where Players run and jump through Sectors.
Definition: game_session.hpp:41