src/object/player.cpp File Reference

#include "object/player.hpp"
#include "audio/sound_manager.hpp"
#include "badguy/badguy.hpp"
#include "control/joystickkeyboardcontroller.hpp"
#include "math/random_generator.hpp"
#include "object/bullet.hpp"
#include "object/camera.hpp"
#include "object/display_effect.hpp"
#include "object/falling_coin.hpp"
#include "object/particles.hpp"
#include "object/portable.hpp"
#include "object/sprite_particle.hpp"
#include "scripting/squirrel_util.hpp"
#include "supertux/game_session.hpp"
#include "supertux/globals.hpp"
#include "supertux/sector.hpp"
#include "supertux/tile.hpp"
#include "trigger/climbable.hpp"
#include <math.h>

Go to the source code of this file.

Variables

static const int TILES_FOR_BUTTJUMP = 3
static const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f
static const float SHOOTING_TIME = .150f
static const unsigned int IDLE_STAGE_COUNT = 5
 number of idle stages, including standing
static const int IDLE_TIME [] = { 5000, 0, 2500, 0, 2500 }
 how long to play each idle animation in milliseconds '0' means the sprite action is played once before moving onto the next animation
static const std::string IDLE_STAGES []
 idle stages
static const float WALK_ACCELERATION_X = 300
 acceleration in horizontal direction when walking (all accelerations are in pixel/s^2)
static const float RUN_ACCELERATION_X = 400
 acceleration in horizontal direction when running
static const float SKID_XM = 200
 acceleration when skidding
static const float SKID_TIME = .3f
 time of skidding in seconds
static const float MAX_WALK_XM = 230
 maximum walk velocity (pixel/s)
static const float MAX_RUN_XM = 320
 maximum run velocity (pixel/s)
static const float MAX_CLIMB_XM = 48
 maximum horizontal climb velocity
static const float MAX_CLIMB_YM = 128
 maximum vertical climb velocity
static const float WALK_SPEED = 100
 instant velocity when tux starts to walk
static const float NORMAL_FRICTION_MULTIPLIER = 1.5f
 multiplied by WALK_ACCELERATION to give friction
static const float ICE_FRICTION_MULTIPLIER = 0.1f
 multiplied by WALK_ACCELERATION to give friction
static const float ICE_ACCELERATION_MULTIPLIER = 0.25f
static const float KICK_TIME = .3f
 time of the kick (kicking mriceblock) animation
static const float CHEER_TIME = 1.0f
 time of tux cheering (currently unused)
static const float UNDUCK_HURT_TIME = 0.25f
 if Tux cannot unduck for this long, he will get hurt
static const float JUMP_EARLY_APEX_FACTOR = 3.0
 gravity is higher after the jump key is released before the apex of the jump is reached
static const float JUMP_GRACE_TIME = 0.25f
 time before hitting the ground that the jump button may be pressed (and still trigger a jump)
static const float TUX_WIDTH = 31.8f
static const float RUNNING_TUX_WIDTH = 34
static const float SMALL_TUX_HEIGHT = 30.8f
static const float BIG_TUX_HEIGHT = 62.8f
static const float DUCKED_TUX_HEIGHT = 31.8f
bool no_water = true


Variable Documentation

const float BIG_TUX_HEIGHT = 62.8f [static]

Definition at line 106 of file player.cpp.

Referenced by Player::do_standup(), Player::init(), Player::move(), and Player::set_bonus().

const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f [static]

Definition at line 44 of file player.cpp.

Referenced by Player::handle_vertical_input().

const float CHEER_TIME = 1.0f [static]

time of tux cheering (currently unused)

Definition at line 92 of file player.cpp.

const float DUCKED_TUX_HEIGHT = 31.8f [static]

Definition at line 107 of file player.cpp.

Referenced by Player::do_duck().

const float ICE_ACCELERATION_MULTIPLIER = 0.25f [static]

Definition at line 87 of file player.cpp.

Referenced by Player::handle_horizontal_input().

const float ICE_FRICTION_MULTIPLIER = 0.1f [static]

multiplied by WALK_ACCELERATION to give friction

Definition at line 86 of file player.cpp.

Referenced by Player::apply_friction().

const unsigned int IDLE_STAGE_COUNT = 5 [static]

number of idle stages, including standing

Definition at line 48 of file player.cpp.

Referenced by Player::draw().

const std::string IDLE_STAGES[] [static]

Initial value:

{ "stand",
  "idle",
  "stand",
  "idle",
  "stand" }
idle stages

Definition at line 56 of file player.cpp.

Referenced by Player::draw().

const int IDLE_TIME[] = { 5000, 0, 2500, 0, 2500 } [static]

how long to play each idle animation in milliseconds '0' means the sprite action is played once before moving onto the next animation

Definition at line 54 of file player.cpp.

Referenced by Player::draw(), and Player::Player().

const float JUMP_EARLY_APEX_FACTOR = 3.0 [static]

gravity is higher after the jump key is released before the apex of the jump is reached

Definition at line 98 of file player.cpp.

Referenced by Player::early_jump_apex().

const float JUMP_GRACE_TIME = 0.25f [static]

time before hitting the ground that the jump button may be pressed (and still trigger a jump)

Definition at line 100 of file player.cpp.

Referenced by Player::handle_vertical_input().

const float KICK_TIME = .3f [static]

time of the kick (kicking mriceblock) animation

Definition at line 90 of file player.cpp.

Referenced by Player::kick().

const float MAX_CLIMB_XM = 48 [static]

maximum horizontal climb velocity

Definition at line 77 of file player.cpp.

Referenced by Player::handle_input_climbing().

const float MAX_CLIMB_YM = 128 [static]

maximum vertical climb velocity

Definition at line 79 of file player.cpp.

Referenced by Player::handle_input_climbing().

const float MAX_RUN_XM = 320 [static]

maximum run velocity (pixel/s)

Definition at line 75 of file player.cpp.

Referenced by Player::handle_horizontal_input(), and Player::handle_input_ghost().

const float MAX_WALK_XM = 230 [static]

maximum walk velocity (pixel/s)

Definition at line 73 of file player.cpp.

Referenced by Player::handle_horizontal_input(), Player::handle_vertical_input(), and Player::update().

bool no_water = true [static]

Definition at line 109 of file player.cpp.

Referenced by Player::collision_tile(), and Player::update().

const float NORMAL_FRICTION_MULTIPLIER = 1.5f [static]

multiplied by WALK_ACCELERATION to give friction

Definition at line 84 of file player.cpp.

Referenced by Player::apply_friction().

const float RUN_ACCELERATION_X = 400 [static]

acceleration in horizontal direction when running

Definition at line 67 of file player.cpp.

Referenced by Player::handle_horizontal_input().

const float RUNNING_TUX_WIDTH = 34 [static]

Definition at line 104 of file player.cpp.

Referenced by Player::update().

const float SHOOTING_TIME = .150f [static]

Definition at line 45 of file player.cpp.

Referenced by Player::handle_input().

const float SKID_TIME = .3f [static]

time of skidding in seconds

Definition at line 71 of file player.cpp.

Referenced by Player::handle_horizontal_input().

const float SKID_XM = 200 [static]

acceleration when skidding

Definition at line 69 of file player.cpp.

Referenced by Player::handle_horizontal_input().

const float SMALL_TUX_HEIGHT = 30.8f [static]

Definition at line 105 of file player.cpp.

Referenced by Player::init(), Player::kill(), and Player::move().

const int TILES_FOR_BUTTJUMP = 3 [static]

Definition at line 43 of file player.cpp.

const float TUX_WIDTH = 31.8f [static]

Definition at line 103 of file player.cpp.

Referenced by Player::init(), Player::move(), and Player::update().

const float UNDUCK_HURT_TIME = 0.25f [static]

if Tux cannot unduck for this long, he will get hurt

Definition at line 95 of file player.cpp.

Referenced by Player::do_standup().

const float WALK_ACCELERATION_X = 300 [static]

acceleration in horizontal direction when walking (all accelerations are in pixel/s^2)

Definition at line 65 of file player.cpp.

Referenced by Player::apply_friction(), and Player::handle_horizontal_input().

const float WALK_SPEED = 100 [static]

instant velocity when tux starts to walk

Definition at line 81 of file player.cpp.

Referenced by Player::apply_friction(), and Player::handle_horizontal_input().


Generated on Mon Apr 21 03:38:20 2014 for SuperTux by  doxygen 1.5.1