crashing into rocks. Current information about vor can be found on the
homepage: http://jasonwoof.org/vor
-To play, press space to start (or 1 for an easy game) then use the arrow keys
-(or the numpad if you prefer) to steer around, dodge rocks, and make your way
-rightward. You can also press F to toggle full-screen mode and P to pause.
+Here are the keys:
+
+ Space: Start playing
+ 1: Switch to easy mode and start playing
+ 2: Switch to normal mode (default) and start playing
+Arrows: Steer (use short taps, and remember to slow down)
+ Esc: Quit
+ F: Toggle full-screen mode
+ P: Pause/unpause
+ 3: Save a screenshot
See INSTALL for instructions on building, running and installing.
// Other global variables
char topline[1024];
char *initerror = "";
+int screenshot_number = 0;
struct ship ship = { SHIP, 0, NULL, XSIZE/2, YSIZE/2, BARRIER_SPEED, 0.0 };
return;
case SDLK_3:
case SDLK_PRINT:
- // FIXME make a unique filename like vor-screenshot-<pid>-<count>.bmp
- SDL_SaveBMP(surf_screen, "snapshot.bmp");
+ {
+ FILE *screenshot_fp;
+ char tmp[30];
+ char *screenshot_filename = &(tmp[0]);
+ for(;;) {
+ snprintf(screenshot_filename, 30, "vor-screenshot-%02i.bmp", screenshot_number++);
+ screenshot_fp = fopen(screenshot_filename, "r");
+ if(screenshot_fp) {
+ fclose(screenshot_fp);
+ } else {
+ break;
+ }
+ }
+ SDL_SaveBMP(surf_screen, screenshot_filename);
+ }
break;
case SDLK_p:
case SDLK_PAUSE: