__NOTOC__
This module contains methods controlling the player. (No, SuperTux doesn't use mind control. Player refers to the type of the player object.)
Due to SuperTux's single-player nature, there is only one instance of the Player
object. You can access it via Tux
from a script and sector.Tux
from the console.
add_bonus(string bonusname) |
Gives Tux the specified bonus. Replace |
---|---|
add_coins(int number) |
Gives Tux |
make_invincible() |
Makes the player invincible for either a predefined amount of time. |
deactivate() |
Stops the player and blocks the movement controls. |
activate() |
Reactivates the player's movement controls. |
walk(float speed) |
Make Tux walk |
set_visible(bool visible) |
Shows or hides Tux according to the value of |
get_visible() |
Returns: |
kill(bool completely) |
Hurts a player, if completely=true then the player will be killed even if he had grow or fireflower bonus. |
set_ghost_mode(bool enable) |
Switches ghost mode on/off. |
get_ghost_mode() |
Returns whether ghost mode is currently enabled |
do_cheer() |
Makes Tux cheer, if possible. |
do_duck() |
Makes Tux duck, if possible. |
do_standup() |
Makes Tux stand up, if possible. |
do_backflip() |
Makes Tux backflip, if possible. |
do_jump() |
Makes Tux jump, if possible. |
trigger_sequence(string sequence_name) |
Orders the current GameSession to start a sequence. One of “stoptux”, “endsequence”, or “fireworks”. |
use_scripting_controller(bool use_or_release) |
Uses a scriptable controller for all user input (or restores controls) |
do_scripting_controller(string control, bool pressed) |
Instructs the scriptable controller to press or release a button. control can be “left”, “right”, “up”, “down”, “jump”, “action”, “pause-menu”, “menu-select”, “console”, “peek-left”, or “peek-right”. |
None