float shipdx = SCREENDXMIN, shipdy = 0.0; // Change in X position per tick.
float screendx = SCREENDXMIN, screendy = 0.0;
float xscroll, yscroll;
float shipdx = SCREENDXMIN, shipdy = 0.0; // Change in X position per tick.
float screendx = SCREENDXMIN, screendy = 0.0;
float xscroll, yscroll;
float bangx, bangy, bangdx, bangdy;
float bangx, bangy, bangdx, bangdy;
//last_i = i + 1;
rawpixel[(int)(s->pitch/2*(int)(bdot[i].y)) + (int)(bdot[i].x)] = bdot[i].c ? bdot[i].c : heatcolor[(int)(bdot[i].life*3)];
bdot[i].life -= bdot[i].decay;
//last_i = i + 1;
rawpixel[(int)(s->pitch/2*(int)(bdot[i].y)) + (int)(bdot[i].x)] = bdot[i].c ? bdot[i].c : heatcolor[(int)(bdot[i].life*3)];
bdot[i].life -= bdot[i].decay;
- edot[i].x += edot[i].dx*gamerate - xscroll;
- edot[i].y += edot[i].dy*gamerate - yscroll;
- if((edot[i].life -= gamerate*3)<0 || edot[i].y<0 || edot[i].y>YSIZE) {
+ edot[i].x += edot[i].dx*framelen - xscroll;
+ edot[i].y += edot[i].dy*framelen - yscroll;
+ if((edot[i].life -= framelen*3)<0 || edot[i].y<0 || edot[i].y>YSIZE) {
- SDL_SetAlpha(surf_b_game, SDL_SRCALPHA, (int)(fadegame*(200 + 55*cos(fadetimer += gamerate/1.0))));
+ SDL_SetAlpha(surf_b_game, SDL_SRCALPHA, (int)(fadegame*(200 + 55*cos(fadetimer += framelen/1.0))));
SDL_BlitSurface(surf_b_game,NULL,surf_screen,&dest);
dest.x = (XSIZE-surf_b_over->w)/2;
SDL_BlitSurface(surf_b_game,NULL,surf_screen,&dest);
dest.x = (XSIZE-surf_b_over->w)/2;
dest.x = (XSIZE-surf_b_variations->w)/2 + cos(fadetimer/6.5)*10;
dest.y = (YSIZE/2-surf_b_variations->h)/2 + sin(fadetimer/5.0)*10;
dest.x = (XSIZE-surf_b_variations->w)/2 + cos(fadetimer/6.5)*10;
dest.y = (YSIZE/2-surf_b_variations->h)/2 + sin(fadetimer/5.0)*10;
SDL_BlitSurface(surf_b_variations,NULL,surf_screen,&dest);
dest.x = (XSIZE-surf_b_on->w)/2 + cos((fadetimer + 1.0)/6.5)*10;
SDL_BlitSurface(surf_b_variations,NULL,surf_screen,&dest);
dest.x = (XSIZE-surf_b_on->w)/2 + cos((fadetimer + 1.0)/6.5)*10;
last_ticks = SDL_GetTicks();
if(ticks_since_last>200 || ticks_since_last<0) {
// We won't run at all below 5 frames per second.
last_ticks = SDL_GetTicks();
if(ticks_since_last>200 || ticks_since_last<0) {
// We won't run at all below 5 frames per second.
- shipdx *= pow((double)0.9,(double)gamerate);
- shipdy *= pow((double)0.9,(double)gamerate);
+ shipdx *= pow((double)0.9,(double)framelen);
+ shipdy *= pow((double)0.9,(double)framelen);
shipdx = screendx - (shipdx-screendx)*opt_bounciness;
}
// BOUNCE Y
if(shipy<0 || shipy>YSIZE-surf_ship->h) {
// BOUNCE from top and bottom wall
shipdx = screendx - (shipdx-screendx)*opt_bounciness;
}
// BOUNCE Y
if(shipy<0 || shipy>YSIZE-surf_ship->h) {
// BOUNCE from top and bottom wall
- if(keystate[SDLK_UP] | keystate[SDLK_c]) { shipdy -= 1.5*gamerate; maneuver |= 1<<3;}
- if(keystate[SDLK_DOWN] | keystate[SDLK_t]) { shipdy += 1.5*gamerate; maneuver |= 1<<1;}
- if(keystate[SDLK_LEFT] | keystate[SDLK_h]) { shipdx -= 1.5*gamerate; maneuver |= 1<<2;}
- if(keystate[SDLK_RIGHT] | keystate[SDLK_n]) { shipdx += 1.5*gamerate; maneuver |= 1;}
+ if(keystate[SDLK_UP] | keystate[SDLK_c]) { shipdy -= 1.5*framelen; maneuver |= 1<<3;}
+ if(keystate[SDLK_DOWN] | keystate[SDLK_t]) { shipdy += 1.5*framelen; maneuver |= 1<<1;}
+ if(keystate[SDLK_LEFT] | keystate[SDLK_h]) { shipdx -= 1.5*framelen; maneuver |= 1<<2;}
+ if(keystate[SDLK_RIGHT] | keystate[SDLK_n]) { shipdx += 1.5*framelen; maneuver |= 1;}