static const float IDLE_TIME = 2.5f;
/** acceleration in horizontal direction when walking
- * (all acceleratiosn are in pixel/s^2) */
+ * (all accelerations are in pixel/s^2) */
static const float WALK_ACCELERATION_X = 300;
/** acceleration in horizontal direction when running */
static const float RUN_ACCELERATION_X = 400;
sound_manager->preload("sounds/hurt.wav");
sound_manager->preload("sounds/skid.wav");
sound_manager->preload("sounds/flip.wav");
- sound_manager->preload("sounds/invincible.wav");
+ sound_manager->preload("sounds/invincible_start.ogg");
sound_manager->preload("sounds/splash.ogg");
- sound_manager->preload("sounds/shoot.wav");
init();
}
dead = false;
dying = false;
- peeking = AUTO;
+ peekingX = AUTO;
+ peekingY = AUTO;
last_ground_y = 0;
fall_mode = ON_GROUND;
jumping = false;
/* Peeking */
if( controller->released( Controller::PEEK_LEFT ) ) {
- peeking = AUTO;
+ peekingX = AUTO;
}
if( controller->released( Controller::PEEK_RIGHT ) ) {
- peeking = AUTO;
+ peekingX = AUTO;
}
if( controller->released( Controller::PEEK_UP ) ) {
- peeking = AUTO;
+ peekingY = AUTO;
}
if( controller->released( Controller::PEEK_DOWN ) ) {
- peeking = AUTO;
+ peekingY = AUTO;
}
if( controller->pressed( Controller::PEEK_LEFT ) ) {
- peeking = LEFT;
+ peekingX = LEFT;
}
if( controller->pressed( Controller::PEEK_RIGHT ) ) {
- peeking = RIGHT;
+ peekingX = RIGHT;
}
if(!backflipping && !jumping && on_ground()) {
if( controller->pressed( Controller::PEEK_UP ) ) {
- peeking = UP;
+ peekingY = UP;
} else if( controller->pressed( Controller::PEEK_DOWN ) ) {
- peeking = DOWN;
+ peekingY = DOWN;
}
}
void
Player::make_invincible()
{
- sound_manager->play("sounds/invincible.wav");
+ sound_manager->play("sounds/invincible_start.ogg");
invincible_timer.start(TUX_INVINCIBLE_TIME);
Sector::current()->play_music(HERRING_MUSIC);
}