static char doc[] = "Dodge the rocks until you die.";
static struct argp_option opts[] = {
{0, 0, 0, 0, "Gameplay Variations:"},
static char doc[] = "Dodge the rocks until you die.";
static struct argp_option opts[] = {
{0, 0, 0, 0, "Gameplay Variations:"},
- {"bounciness", 'b', "N%", 0, "keep N% of speed when hitting edges (default 50%)"},
+ {"bounciness", 'b', "N%", 0, "Keep N% of speed when hitting edges (default 50%)"},
{"game-speed", 'g', "N%", 0, "50-100% (default 100%)"},
{"game-speed", 'g', "N%", 0, "50-100% (default 100%)"},
- {"bad-physics", 'p', 0, 0, "bad physics (i.e. friction)"},
+ {"max-lead", 'l', "#SCREENS", 0, "Max dist. ahead you can get (default 1 screen)\n(negative value means no limit)"},
+ {"bad-physics", 'p', 0, 0, "Bad physics (i.e. friction)"},
{0, 0, 0, 0, "Look and Feel:"},
{"engine", 'e', 0, 0, "Display large tail plume"},
{"full-screen", 'f', 0, 0, ""},
{"music", 'm', 0, 0, "Enable music"},
{0, 0, 0, 0, "Look and Feel:"},
{"engine", 'e', 0, 0, "Display large tail plume"},
{"full-screen", 'f', 0, 0, ""},
{"music", 'm', 0, 0, "Enable music"},
- {"silent", 's', 0, 0, "Turn off explosion sounds"},
+ {"silent", 's', 0, 0, "No explosion sounds or music"},
{0, 0, 0, 0, "Informational:", -1},
{0}
};
{0, 0, 0, 0, "Informational:", -1},
{0}
};
- case 'f': opt_fullscreen = 1; break;
- case 'm': opt_music = 1; break;
- case 's': opt_sound = 0; opt_music = 0; break;
- case 'b': i = 0; sscanf(arg, "%d%%", &i);
+ case 'b': if(!sscanf(arg, "%d%%", &i)) {
+ argp_error(state, "bad --bounciness (-b) value (should be 0-100%%)");
+ return EINVAL;
+ }
- case 'g': i = 0; sscanf(arg, "%d%%", &i);
+ case 'e': opt_tail_engine = 1; break;
+ case 'f': opt_fullscreen = 1; break;
+ case 'g': if(!sscanf(arg, "%d%%", &i)) {
+ argp_error(state, "bad --gamespeed (-g) value (should be 50-100%%)");
+ return EINVAL;
+ }
- case 'e': opt_tail_engine = 1; break;
+ case 'l': if(!sscanf(arg, "%f", &opt_max_lead)) {
+ argp_error(state, "bad --max-limit (-l) value (must be a number)");
+ return EINVAL;
+ }
+ opt_max_lead *= XSIZE;
+ break;
+ case 'm': opt_music = 1; break;