-
-
Notifications
You must be signed in to change notification settings - Fork 539
ScriptingPlayer
__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
Template:Navbox Scripting reference
Category:Scripting Reference
Home
Guidelines
Game Mechanics
Tools
Engine
- Cameras in other games
- Collision
- Configuration File
- Console
- Cutscenes
- Game_Engine
- Lighting
- Map_transformer
- Portables
- SceneGraph
- Scripting
Specifications
Milestones
- Milestone 1 Analysis
- Milestone 2 Design Document
- Milestone 2 Design Document Old
- Milestone 3 Design Document
Building (mostly outdated)
- INSTALL.md
- Building
- Building on macOS
- Building SuperTux
- Building on Windows
- Building with MXE (cross-compile)
Meetings