to a max of 45 at 2:00 minutes into the game.
See config.h: I_ROCKS/F_ROCKS.
#define NROCKS 50
// image file containing font for score stuff.
#define BIG_FONT_FILE "fonts/score.png"
#define NROCKS 50
// image file containing font for score stuff.
#define BIG_FONT_FILE "fonts/score.png"
+#define I_ROCKS 25 // initial/final counts for rocks-on-screen.
+#define F_ROCKS 45
#define MAXROCKS 120 // MAX Rocks
#define MAXROCKHEIGHT 100
#define MAXROCKS 120 // MAX Rocks
#define MAXROCKHEIGHT 100
float bangx, bangy, bangdx, bangdy;
float bangx, bangy, bangdx, bangdy;
-int nships,score,initticks,ticks_since_last, last_ticks;
+int nships,score,ticks_since_last, last_ticks;
int gameover;
int maneuver = 0;
int sound_flag, music_flag;
int gameover;
int maneuver = 0;
int sound_flag, music_flag;
- initticks = SDL_GetTicks();
// timers for rock generation.
float rtimers[4];
// timers for rock generation.
float rtimers[4];
+
+uint32_t nrocks;
+uint32_t nrocks_timer;
+uint32_t nrocks_inc_ticks = 2*60*1000/(F_ROCKS-I_ROCKS);
// constants for rock generation.
#define KH 32.0 // 32 s for a speed=1 rock to cross the screen horizontally.
// constants for rock generation.
#define KH 32.0 // 32 s for a speed=1 rock to cross the screen horizontally.
NULLERROR(surf_rock[i] = SDL_DisplayFormat(temp));
get_shape(surf_rock[i], &rock_shapes[i]);
}
NULLERROR(surf_rock[i] = SDL_DisplayFormat(temp));
get_shape(surf_rock[i], &rock_shapes[i]);
}
int i;
for(i = 0; i<MAXROCKS; i++) rock[i].active = 0;
int i;
for(i = 0; i<MAXROCKS; i++) rock[i].active = 0;
+ nrocks = I_ROCKS;
+ nrocks_timer = 0;
}
enum { LEFT, RIGHT, TOP, BOTTOM };
}
enum { LEFT, RIGHT, TOP, BOTTOM };
+ if(nrocks < F_ROCKS) {
+ nrocks_timer += ticks_since_last;
+ if(nrocks_timer >= nrocks_inc_ticks) {
+ nrocks_timer -= nrocks_inc_ticks;
+ nrocks++;
+ }
+ }
+
rock_timer_increments(ti);
for(i=0; i<4; i++) {
rock_timer_increments(ti);
for(i=0; i<4; i++) {