}
Sprite* sprite = (dir == LEFT) ? sprite_left : sprite_right;
- sprite->draw(base.x - scroll_x, base.y);
+ sprite->draw(base.x, base.y);
if (debug_mode)
- fillrect(base.x - scroll_x, base.y, base.width, base.height, 75,0,75, 150);
+ fillrect(base.x, base.y, base.width, base.height, 75,0,75, 150);
}
void
{
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x,
+ World::current()->add_score(base.x,
base.y, 50 * player_status.score_multiplier);
play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
player_status.score_multiplier++;
World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x, base.y, 50 * player_status.score_multiplier);
+ World::current()->add_score(base.x, base.y, 50 * player_status.score_multiplier);
play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
player_status.score_multiplier++;
remove_me();
make_player_jump(player);
- World::current()->add_score(base.x - scroll_x, base.y, 25 * player_status.score_multiplier);
+ World::current()->add_score(base.x, base.y, 25 * player_status.score_multiplier);
player_status.score_multiplier++;
// simply remove the fish...
physic.enable_gravity(true);
/* Gain some points: */
- World::current()->add_score(base.x - scroll_x, base.y,
+ World::current()->add_score(base.x, base.y,
score * player_status.score_multiplier);
/* Play death sound: */
{
if (dying == DYING_SQUISHED)
{
- smalltux_gameover->draw(base.x - scroll_x, base.y);
+ smalltux_gameover->draw(base.x, base.y);
}
else
{
if (duck && size != SMALL)
{
if (dir == RIGHT)
- sprite->duck_right->draw(base.x - scroll_x, base.y);
+ sprite->duck_right->draw(base.x, base.y);
else
- sprite->duck_left->draw(base.x - scroll_x, base.y);
+ sprite->duck_left->draw(base.x, base.y);
}
else if (skidding_timer.started())
{
if (dir == RIGHT)
- sprite->skid_right->draw(base.x - scroll_x, base.y);
+ sprite->skid_right->draw(base.x, base.y);
else
- sprite->skid_left->draw(base.x - scroll_x, base.y);
+ sprite->skid_left->draw(base.x, base.y);
}
else if (kick_timer.started())
{
if (dir == RIGHT)
- sprite->kick_right->draw(base.x - scroll_x, base.y);
+ sprite->kick_right->draw(base.x, base.y);
else
- sprite->kick_left->draw(base.x - scroll_x, base.y);
+ sprite->kick_left->draw(base.x, base.y);
}
else if (physic.get_velocity_y() != 0)
{
if (dir == RIGHT)
- sprite->jump_right->draw(base.x - scroll_x, base.y);
+ sprite->jump_right->draw(base.x, base.y);
else
- sprite->jump_left->draw(base.x - scroll_x, base.y);
+ sprite->jump_left->draw(base.x, base.y);
}
else
{
if (fabsf(physic.get_velocity_x()) < 1.0f) // standing
{
if (dir == RIGHT)
- sprite->stand_right->draw( base.x - scroll_x, base.y);
+ sprite->stand_right->draw( base.x, base.y);
else
- sprite->stand_left->draw( base.x - scroll_x, base.y);
+ sprite->stand_left->draw( base.x, base.y);
}
else // moving
{
if (dir == RIGHT)
- sprite->walk_right->draw(base.x - scroll_x, base.y);
+ sprite->walk_right->draw(base.x, base.y);
else
- sprite->walk_left->draw(base.x - scroll_x, base.y);
+ sprite->walk_left->draw(base.x, base.y);
}
}
if (holding_something && physic.get_velocity_y() == 0)
{
if (dir == RIGHT)
- sprite->grab_right->draw(base.x - scroll_x, base.y);
+ sprite->grab_right->draw(base.x, base.y);
else
- sprite->grab_left->draw(base.x - scroll_x, base.y);
+ sprite->grab_left->draw(base.x, base.y);
}
// Draw blinking star overlay
(invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3))
{
if (size == SMALL || duck)
- smalltux_star->draw(base.x - scroll_x, base.y);
+ smalltux_star->draw(base.x, base.y);
else
- largetux_star->draw(base.x - scroll_x, base.y);
+ largetux_star->draw(base.x, base.y);
}
}
}
if (debug_mode)
- fillrect(base.x - scroll_x, base.y,
+ fillrect(base.x, base.y,
base.width, base.height, 75,75,75, 150);
}
{
pbad_c->dying = DYING_FALLING;
play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
- World::current()->add_score(pbad_c->base.x - scroll_x,
+ World::current()->add_score(pbad_c->base.x,
pbad_c->base.y,
25 * player_status.score_multiplier);
}
if (base.x >= scroll_x - base.width &&
base.x <= scroll_x + screen->w)
{
- img_bullet->draw(base.x - scroll_x, base.y);
+ img_bullet->draw(base.x, base.y);
}
}
{
/* Rising up... */
- dest.x = (int)(base.x - scroll_x);
+ dest.x = (int)(base.x);
dest.y = (int)(base.y + 32 - base.height);
dest.w = 32;
dest.h = (int)base.height;
if (kind == UPGRADE_GROWUP)
{
img_growup->draw(
- base.x - scroll_x, base.y);
+ base.x, base.y);
}
else if (kind == UPGRADE_ICEFLOWER)
{
img_iceflower->draw(
- base.x - scroll_x, base.y);
+ base.x, base.y);
}
else if (kind == UPGRADE_HERRING)
{
img_star->draw(
- base.x - scroll_x, base.y);
+ base.x, base.y);
}
else if (kind == UPGRADE_1UP)
{
- img_1up->draw( base.x - scroll_x, base.y);
+ img_1up->draw( base.x, base.y);
}
}
}
unsigned int frame = get_current_frame();
if (frame < surfaces.size())
- surfaces[frame]->draw(x - x_hotspot, y - y_hotspot - scroll_y);
+ surfaces[frame]->draw(x - x_hotspot - scroll_x, y - y_hotspot - scroll_y);
}
void
return;
}
- int tux_pos_x = (int)(tux.base.x + (tux.base.width/2));
+ float tux_pos_x = tux.base.x + (tux.base.width/2);
if (level->back_scrolling || debug_mode)
{
/* Y-axis scrolling */
- int tux_pos_y = (int)(tux.base.y + (tux.base.height/2));
+ float tux_pos_y = tux.base.y + (tux.base.height/2);
scroll_y = tux_pos_y - (screen->h / 2);
player_status.score += s;
FloatingScore* new_floating_score = new FloatingScore();
- new_floating_score->init(x,y,s);
+ new_floating_score->init(x-scroll_x, y-scroll_y, s);
floating_scores.push_back(new_floating_score);
}
World::add_bouncy_distro(float x, float y)
{
BouncyDistro* new_bouncy_distro = new BouncyDistro();
- new_bouncy_distro->init(x,y);
+ new_bouncy_distro->init(x, y);
bouncy_distros.push_back(new_bouncy_distro);
}