- double theta, theta2, dx, dy, adx, ady;
-
- // Don't create fresh engine dots when
- // the game is not being played and a demo is not beng shown
- if(state != GAMEPLAY && state != DEMO) return;
-
- for(i = 0; i<newdots; i++) {
- if(dotptr->active == 0) {
- theta = rnd()*M_PI*2;
- theta2 = rnd()*M_PI*2;
-
- dx = cos(theta) * fabs(cos(theta2));
- dy = sin(theta) * fabs(cos(theta2));
- adx = fabs(dx);
- ady = fabs(dy);
-
-
- dotptr->active = 1;
- dotptr->x = xship + surf_ship->w/2 + (rnd()-0.5)*3;
- dotptr->y = yship + surf_ship->h/2 + (rnd()-0.5)*3;
-
- switch(m) {
- case 0:
- dotptr->x -= 14;
- dotptr->dx = -20*adx + xvel;
- dotptr->dy = 2*dy + yvel;
- dotptr->life = 60 * adx;
- break;
- case 1:
- dotptr->dx = 2*dx + xvel;
- dotptr->dy = -20*ady + yvel;
- dotptr->life = 60 * ady;
- break;
- case 2:
- dotptr->x += 14;
- dotptr->dx = 20*adx + xvel;
- dotptr->dy = 2*dy + yvel;
- dotptr->life = 60 * adx;
- break;
- case 3:
- dotptr->dx = 2*dx + xvel;
- dotptr->dy = 20*ady + yvel;
- dotptr->life = 60 * ady;
- break;
- }
- dotptr++;
- if(dotptr-edot >= MAXENGINEDOTS) {
- dotptr = edot;
- }
- }
- }
-}
-
-int drawdots(SDL_Surface *s) {
- int m, scorepos, n;
-
- SDL_LockSurface(s);
- // Draw the background stars aka space dots
- draw_space_dots(s);
-
- // Draw the score when playing the game or whn the game is freshly over
- if(1 || state == GAMEPLAY || state == DEAD_PAUSE || state == GAME_OVER ) {
- SDL_UnlockSurface(s);
-
- scorepos = XSIZE-250;
- n = snprintf(topline, 50, "Time: ");
- snprintscore(topline + n, 50-n, score);
- PutString(s,scorepos,0,topline);
-
- SDL_LockSurface(s);
- }