-int drawlaser() {
- int i,xc,hitrock;
- Uint16 c, *rawpixel;
-
- hitrock = -1;
- xc = XSIZE;
- // let xc = x coordinate of the collision between the laser and a space rock
- // 1. Calculate xc and determine the asteroid that was hit
- for(i = 0; i<MAXROCKS; i++) {
- if(rock[i].active) {
- if(yship + 12>rock[i].y && yship + 12<rock[i].y + rock[i].image->h && xship + 32<rock[i].x + (rock[i].image->w/2) && rock[i].x + (rock[i].image->w/2) < xc) {
- xc = rock[i].x + (rock[i].image->w/2);
- hitrock = i;
- }
- }
- }
-
- if(hitrock >= 0) {
- rock[hitrock].heat += movementrate*3;
- }
-
- // Plot a number of random dots between xship and XSIZE
- SDL_LockSurface(surf_screen);
- rawpixel = (Uint16 *) surf_screen->pixels;
- c = SDL_MapRGB(surf_ship->format,rnd()*128,128 + rnd()*120,rnd()*128);
-
- for(i = 0; i<(xc-xship)*5; i += 10) {
- int x,y;
- x = rnd()*(xc-(xship + 32)) + xship + 32;
- y = yship + 12 + (rnd()-0.5)*1.5;
- rawpixel[surf_screen->pitch/2*y + x] = c;
- }
-
- SDL_UnlockSurface(surf_screen);
-}
-
-
-int makebangdots(int xbang, int ybang, int xvel, int yvel, SDL_Surface *s, int power) {
+void makebangdots(int xbang, int ybang, int xvel, int yvel, SDL_Surface *s, int power) {