- PutString(surf_screen,180,50,"High scores");
- for(i = 0; i<8; i++) {
- char s[1024];
- sprintf(s, "#%1d",i + 1);
- PutString(surf_screen, 150, 50 + (i + 2)*font_height,s);
- snprintscore(s, 1024, high[i].score);
- PutString(surf_screen, 200, 50 + (i + 2)*font_height,s);
- sprintf(s, "%3s", high[i].name);
- PutString(surf_screen, 330, 50 + (i + 2)*font_height,s);
- }
-
- }
-
- if(!gameover && state == GAMEPLAY) {
- // Show the freaky shields
- SDL_LockSurface(surf_screen);
- raw_pixels = (Uint16 *) surf_screen->pixels;
- if(initialshield>0 || shieldsup && shieldlevel>0) {
- int x,y,l;
- Uint16 c;
-
- if(initialshield>0) {
- initialshield -= movementrate;
- c = SDL_MapRGB(surf_screen->format,0,255,255);
- } else {
- c = heatcolor[(int)shieldlevel];
- shieldlevel -= movementrate;
- }
-
- shieldpulse += 0.2;
- for(p = black_point; p<blackptr; p++) {
- x = p->x + (int)xship + (rnd() + rnd()-1)*sin(shieldpulse)*4 + 1;
- y = p->y + (int)yship + (rnd() + rnd()-1)*sin(shieldpulse)*4 + 1;
- if(x>0 && y>0 && x<XSIZE && y<YSIZE) {
- offset = surf_screen->pitch/2 * y + x;
- raw_pixels[offset] = c;
- }
- }
- } else {
- // When the shields are off, check that the black points
- // on the ship are still black, and not covered up by rocks
- for(p = black_point; p<blackptr; p++) {
- offset = surf_screen->pitch/2 * (p->y + (int)yship) + p->x + (int)xship;
- if(raw_pixels[offset]) {
- // Set the bang flag
- bang = 1;
- }
- }
- }
- SDL_UnlockSurface(surf_screen);