// Description:
//
//
-// Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
+// Author: Tobias Glaesser <tobi.web@gmx.de> & Bill Kendrick, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
{
pbullet->base.width = 4;
pbullet->base.height = 4;
- pbullet->base.updated = SDL_GetTicks();
pbullet->base.alive = YES;
if (dir == RIGHT)
void bullet_action(bullet_type* pbullet)
{
-
- double frame_ratio = get_frame_ratio(&pbullet->base);
-
if (pbullet->base.alive)
{
pbullet->base.x = pbullet->base.x + pbullet->base.xm * frame_ratio;
pupgrade->base.xm = 2;
pupgrade->base.ym = -2;
pupgrade->base.height = 0;
- pupgrade->base.updated = SDL_GetTicks();
}
void upgrade_action(upgrade_type *pupgrade)
{
- double frame_ratio = get_frame_ratio(&pupgrade->base);
if (pupgrade->base.alive)
{
{
/* Rise up! */
- pupgrade->base.height++;
+ pupgrade->base.height = pupgrade->base.height + 0.7 * frame_ratio;
+ if(pupgrade->base.height > 32)
+ pupgrade->base.height = 32;
}
else
{
}
else if (pupgrade->kind == UPGRADE_HERRING)
{
- pupgrade->base.ym = -24;
+ pupgrade->base.ym = -8;
}
pupgrade->base.y = (int)(pupgrade->base.y / 32) * 32;
/* Off the screen? Kill it! */
- if (pupgrade->base.x < scroll_x)
+ if (pupgrade->base.x < scroll_x - pupgrade->base.width)
pupgrade->base.alive = NO;
}
dest.w = 32;
dest.h = pupgrade->base.height;
- src.x = 0;
- src.y = 0;
- src.w = 32;
- src.h = pupgrade->base.height;
-
if (pupgrade->kind == UPGRADE_MINTS)
- SDL_BlitSurface(img_mints.sdl_surface, &src, screen, &dest);
+ texture_draw_part(&img_mints,0,0,dest.x,dest.y,dest.w,dest.h,NO_UPDATE);
else if (pupgrade->kind == UPGRADE_COFFEE)
- SDL_BlitSurface(img_coffee.sdl_surface, &src, screen, &dest);
+ texture_draw_part(&img_coffee,0,0,dest.x,dest.y,dest.w,dest.h,NO_UPDATE);
else if (pupgrade->kind == UPGRADE_HERRING)
- SDL_BlitSurface(img_golden_herring.sdl_surface, &src, screen, &dest);
+ texture_draw_part(&img_golden_herring,0,0,dest.x,dest.y,dest.w,dest.h,NO_UPDATE);
}
else
{
else if (pupgrade->kind == UPGRADE_HERRING)
{
play_sound(sounds[SND_HERRING], SOUND_CENTER_SPEAKER);
- timer_start(&tux.invincible_timer,TUX_INVINCIBLE_TIME);
+ timer_start(&pplayer->invincible_timer,TUX_INVINCIBLE_TIME);
timer_start(&super_bkgd_timer, 250);
/* play the herring song ^^ */
if (current_music != HURRYUP_MUSIC)