const int MAX_BULLETS = 32;
unsigned int score = 0;
Rectangle screenspace = {-200, -200, scrW+200, scrH+200};
+time_t last_fire = 0;
// x/y pos, z heading, w size/life
Vector4* asteroids;
continue;
dead_ship[i].x = center.x; dead_ship[i].y = center.y;
dead_ship[i].z = (360/SHIP_DEBRIS) * (i + 1);
- dead_ship[i].w = 4;
+ dead_ship[i].w = 6;
}
}
void shoot(){
for(int i = 0; i < MAX_BULLETS; i++){
// find available bullet
- if(bullets[i].w == 0) {
+ if(bullets[i].w == 0 && time(NULL) > last_fire) {
bullets[i].x = center.x;
bullets[i].y = center.y;
bullets[i].z = nose.z;
bullets[i].w = 1;
+ time(&last_fire);
break;
}
}