|
| Player (PlayerStatus &player_status, const std::string &name, int player_id) |
|
virtual void | update (float dt_sec) override |
| This function is called once per frame and allows the object to update it's state. More...
|
|
virtual void | draw (DrawingContext &context) override |
| The GameObject should draw itself onto the provided DrawingContext if this function is called. More...
|
|
virtual void | collision_solid (const CollisionHit &hit) override |
| this function is called when the object collided with something solid
|
|
virtual HitResponse | collision (GameObject &other, const CollisionHit &hit) override |
| this function is called when the object collided with any other object
|
|
virtual void | collision_tile (uint32_t tile_attributes) override |
| called when tiles with special attributes have been touched
|
|
virtual void | on_flip (float height) override |
| When level is flipped vertically.
|
|
virtual bool | is_saveable () const override |
| Indicates if the object will be saved. More...
|
|
virtual bool | is_singleton () const override |
| If true only a single object of this type is allowed in a given GameObjectManager.
|
|
virtual bool | has_object_manager_priority () const override |
| Indicates if the object should be added at the beginning of the object list. More...
|
|
virtual std::string | get_exposed_class_name () const override |
|
virtual void | remove_me () override |
| schedules this object to be removed at the end of the frame
|
|
virtual GameObjectClasses | get_class_types () const override |
| List notable classes in inheritance hierarchy of class. More...
|
|
int | get_id () const |
|
void | set_id (int id) |
|
virtual int | get_layer () const override |
|
void | set_controller (const Controller *controller) |
|
void | set_winning () |
| Level solved. More...
|
|
bool | is_winning () const |
|
void | set_speedlimit (float newlimit) |
|
float | get_speedlimit () const |
|
const Controller & | get_controller () const |
|
void | use_scripting_controller (bool enable) |
| Uses a scriptable controller for all user input (or restores controls). More...
|
|
void | do_scripting_controller (const std::string &control, bool pressed) |
| Instructs the scriptable controller to press or release a button. More...
|
|
void | move_to_sector (Sector &other) |
| Move the player to a different sector, including any objects that it points to, or references. More...
|
|
void | make_invincible () |
| Make Tux invincible for a short amount of time.
|
|
void | make_temporarily_safe (float safe_time) |
|
bool | is_invincible () const |
|
bool | is_dying () const |
|
Direction | peeking_direction_x () const |
|
Direction | peeking_direction_y () const |
|
void | kill (bool completely) |
| Hurts Tux. More...
|
|
void | set_pos (const Vector &vector) override |
|
bool | add_bonus (const std::string &bonus) |
| Gives Tux the specified bonus unless Tux’s current bonus is superior. More...
|
|
bool | set_bonus (const std::string &bonus) |
| Gives Tux the specified bonus. More...
|
|
void | add_coins (int count) |
| Gives the player a number of coins. More...
|
|
int | get_coins () const |
| Returns the number of coins the player currently has.
|
|
bool | add_bonus (BonusType type, bool animate=false) |
| picks up a bonus, taking care not to pick up lesser bonus items than we already have More...
|
|
bool | set_bonus (BonusType type, bool animate=false, bool increment_powerup_counter=true) |
| like add_bonus, but can also downgrade the bonus items carried
|
|
BonusType | get_bonus () const |
|
std::string | bonus_to_string () const |
|
PlayerStatus & | get_status () const |
|
void | kick () |
| Start kick animation.
|
|
std::string | get_action () const |
| Gets the player's current action/animation.
|
|
void | do_cheer () |
| Play cheer animation. More...
|
|
void | do_duck () |
| Makes Tux duck down, if possible. More...
|
|
void | do_standup () |
| Makes Tux stand back up, if possible.
|
|
void | do_standup (bool force_standup) |
| Makes Tux stand back up, if possible.
|
|
void | do_backflip () |
| Makes Tux do a backflip, if possible.
|
|
void | do_jump (float yspeed) |
| Makes Tux jump in the air, if possible. More...
|
|
void | add_velocity (const Vector &velocity) |
| Adds velocity to the player (be careful when using this)
|
|
void | add_velocity (const Vector &velocity, const Vector &end_speed) |
| Adds velocity to the player until given end speed is reached.
|
|
Vector | get_velocity () const |
| Returns the current velocity of the player.
|
|
float | get_velocity_x () const |
| Returns Tux’s velocity in X direction.
|
|
float | get_velocity_y () const |
| Returns Tux’s velocity in Y direction.
|
|
void | set_velocity (float x, float y) |
| Sets the velocity of the player to a programmable/variable speed. More...
|
|
void | bounce (BadGuy &badguy) |
|
void | override_velocity () |
|
bool | is_dead () const |
|
bool | is_big () const |
|
bool | is_stone () const |
|
bool | is_sliding () const |
|
bool | is_swimming () const |
|
bool | is_swimboosting () const |
|
bool | is_water_jumping () const |
|
bool | is_skidding () const |
|
float | get_swimming_angle () const |
|
void | set_visible (bool visible) |
|
bool | get_visible () const |
|
bool | on_ground () const |
|
void | set_on_ground (bool flag) |
|
Portable * | get_grabbed_object () const |
|
void | stop_grabbing () |
|
bool | has_grabbed (const std::string &name) const |
| Returns whether the player is carrying a certain object. More...
|
|
void | set_ghost_mode (bool enable) |
| Switches ghost mode on/off. More...
|
|
bool | get_ghost_mode () const |
| Returns whether ghost mode is currently enabled.
|
|
bool | adjust_height (float new_height, float bottom_offset=0) |
| Changes height of bounding box. More...
|
|
void | trigger_sequence (const std::string &sequence_name) |
| Orders the current ""GameSession"" to start a sequence. More...
|
|
void | trigger_sequence (const std::string &sequence_name, const SequenceData *data) |
| Orders the current GameSession to start a sequence. More...
|
|
void | trigger_sequence (Sequence seq, const SequenceData *data=nullptr) |
| Orders the current GameSession to start a sequence. More...
|
|
void | start_climbing (Climbable &climbable) |
| Requests that the player start climbing the given Climbable.
|
|
void | stop_climbing (Climbable &climbable) |
| Requests that the player stop climbing the given Climbable.
|
|
Physic & | get_physic () |
|
void | activate () |
| Give control back to user/scripting.
|
|
void | deactivate () |
| Deactivate user/scripting input for Tux. More...
|
|
bool | get_input_pressed (const std::string &input) |
| Gets whether the current input on the keyboard/controller/touchpad has been pressed. More...
|
|
bool | get_input_held (const std::string &input) |
| Gets whether the current input on the keyboard/controller/touchpad is being held. More...
|
|
bool | get_input_released (const std::string &input) |
| Gets whether the current input on the keyboard/controller/touchpad has been released. More...
|
|
void | walk (float speed) |
| Makes Tux walk. More...
|
|
void | set_dir (bool right) |
| Face Tux in the proper direction. More...
|
|
void | stop_backflipping () |
|
void | position_grabbed_object (bool teleport=false) |
|
bool | try_grab () |
|
void | sideways_push (float delta) |
| Boosts Tux in a certain direction, sideways. More...
|
|
void | multiplayer_prepare_spawn () |
|
void | set_ending_direction (int direction) |
|
int | get_ending_direction () const |
|
const std::vector< Key * > & | get_collected_keys () const |
|
void | add_collected_key (Key *key) |
|
void | remove_collected_key (Key *key) |
|
bool | track_state () const override |
| Indicates if the object's state should be tracked. More...
|
|
| MovingObject (const ReaderMapping &reader) |
|
virtual bool | collides (GameObject &, const CollisionHit &) const override |
| when 2 objects collided, we will first call the collision functions of both objects that can decide on how to react to the collision. More...
|
|
virtual void | move_to (const Vector &pos) |
|
virtual void | move (const Vector &dist) |
|
virtual bool | listener_is_valid () const override |
|
Vector | get_pos () const |
|
const Rectf & | get_bbox () const |
|
const Vector & | get_movement () const |
|
CollisionGroup | get_group () const |
|
CollisionObject * | get_collision_object () |
|
const CollisionObject * | get_collision_object () const |
|
void | set_parent_dispenser (Dispenser *dispenser) |
|
Dispenser * | get_parent_dispenser () const |
|
virtual std::string | get_class_name () const override |
|
virtual ObjectSettings | get_settings () override |
|
virtual void | editor_select () override |
| The user clicked on the object in the editor and selected it.
|
|
float | get_x () const |
| Returns the object's X coordinate.
|
|
float | get_y () const |
| Returns the object's Y coordinate.
|
|
void | set_pos (float x, float y) |
| Sets the position of the object. More...
|
|
void | move (float x, float y) |
| Moves the object by ""x"" units to the right and ""y"" down, relative to its current position. More...
|
|
float | get_width () const |
| Returns the object's hitbox width.
|
|
float | get_height () const |
| Returns the object's hitbox height.
|
|
| GameObject (const std::string &name) |
|
| GameObject (const ReaderMapping &reader) |
|
virtual void | finish_construction () |
| Called after all objects have been added to the Sector and the Sector is fully constructed. More...
|
|
UID | get_uid () const |
|
virtual void | save (Writer &writer) |
| This function saves the object. More...
|
|
std::string | save () |
|
virtual std::string | get_display_name () const |
| Returns the display name of the object, translated to the user's locale.
|
|
virtual std::vector< std::string > | get_patches () const |
| Version checking/updating, patch information.
|
|
virtual void | update_version () |
|
int | get_version () const |
| Returns the current version of the object.
|
|
int | get_latest_version () const |
| Returns the latest version of the object.
|
|
bool | is_up_to_date () const |
| Checks whether the object's current version is equal to its latest one.
|
|
virtual bool | has_variable_size () const |
| Does this object have variable size (secret area trigger, wind, etc.)
|
|
virtual bool | has_settings () const |
| Indicates if get_settings() is implemented. More...
|
|
virtual GameObjectTypes | get_types () const |
| Get all types of the object, if available. More...
|
|
int | get_type () const |
| Returns the type index of the object.
|
|
virtual void | after_editor_set () |
|
bool | is_valid () const |
| returns true if the object is not scheduled to be removed yet
|
|
void | add_remove_listener (ObjectRemoveListener *listener) |
| registers a remove listener which will be called if the object gets removed/destroyed
|
|
void | del_remove_listener (ObjectRemoveListener *listener) |
| unregisters a remove listener, so it will no longer be called if the object gets removed/destroyed
|
|
void | set_name (const std::string &name) |
|
const std::string & | get_name () const |
| Returns the name of the object.
|
|
virtual const std::string | get_icon_path () const |
|
virtual void | stop_looping_sounds () |
| stops all looping sounds
|
|
virtual void | play_looping_sounds () |
| continues all looping sounds
|
|
template<typename T > |
T * | get_component () |
|
void | add_component (std::unique_ptr< GameObjectComponent > component) |
|
void | remove_component (GameObjectComponent *component) |
|
virtual void | save_state () |
| Save/check the current state of the object. More...
|
|
virtual void | check_state () |
|
virtual void | editor_delete () |
| The editor requested the deletion of the object.
|
|
virtual void | editor_deselect () |
| The object got deselected.
|
|
virtual void | editor_update () |
| Called each frame in the editor, used to keep linked objects together (e.g. More...
|
|
GameObjectManager * | get_parent () const |
|
This module contains methods controlling the player.
(No, SuperTux doesn't use mind control. ""Player"" refers to the type of the player object.) The first player can be accessed using ""Tux"", or ""sector.Tux"" from the console. All following players (2nd, 3rd, etc...) can be accessed by ""Tux{index}"". For example, to access the 2nd player, use ""Tux1"" (or ""sector.Tux1"" from the console).