* are received, the input queue can start filling with only one character
* processed per frame, delaying actions to user commands. For this reason,
* when a successful character is received, the input queue is also cleared.
- * XXX For some reason, despite using this method the game appears to
- * accelerate a bit at user input, although less drasticly than it used to
- * with only halfdelay(3), as originally implemented.
+ * Depending on the curses implementation and port, it is possible for polling
+ * with an excessive delay to occur, causing the clock to accelerate when user
+ * input occurs, but still less than with the original halfdelay(3) based
+ * clock.
*/
static int
frame_getch(void)
missiles[missileloop].chase = -1;
};
+
if ((win = initscr()) == NULL)
err(EXIT_FAILURE, "initscr()");
};
(void)atexit(cleanup);
+ (void)cbreak();
+ (void)noecho();
+ (void)nonl();
+ (void)leaveok(win, FALSE);
+ (void)keypad(win, TRUE);
+ (void)intrflush(stdscr, FALSE);
+ (void)curs_set(0);
+ (void)timeout(0);
+
int loopvar = 0;
int podcount = 0;
int smartbombs = 2;
int drawlaser = 0;
- (void)cbreak();
- (void)noecho();
- (void)nonl();
- (void)leaveok(win, FALSE);
- (void)keypad(win, TRUE);
- (void)intrflush(stdscr, FALSE);
- (void)curs_set(0);
- (void)timeout(0);
-
//print title screen
lives = 4;
//Reset level
level = 1;
- //Drop shields
- /* XXX
- shieldup = 0;
- */
+ //Temporary supershield
tempshield();
player.speed = 0;
player.vspeed = 0;
};
score = 0;
newgame = 0;
+ // Reset position and speed
+ drawlocation = 0;
+ player.x = 8;
+ player.y = 35;
+ player.speed = 0;
+ player.vspeed = 0;
};
//lander pod grab logic
//Advance level
level++;
- //Drop shields XXX
- //shieldup = 0;
+ //Temporary supershield
tempshield();
- // Reset speed
+ // Reset position and speed
+ drawlocation = 0;
+ player.x = 8;
+ player.y = 35;
player.speed = 0;
player.vspeed = 0;
//Reactivate pods if not zombied