- SDL_LockSurface(surf_screen);
- raw_pixels = (Uint16 *) surf_screen->pixels;
- // 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)shipy) + p->x + (int)shipx;
- if(raw_pixels[offset]) {
- // Set the bang flag
- bang = 1;
+ for(i=0; i<MAXROCKS; i++) {
+ if(rock[i].active) {
+ if(collide(shipx-rock[i].x, shipy-rock[i].y, rock[i].shape, &shipshape))
+ bang = 1;