Beispiel #1
0
/* Initialise the game clock */
void gameTimeInit(void)
{
	unsigned player;

	/* Start the timer off at 2 so that when the scripts strip the map of objects
	 * for multiPlayer they will be processed as if they died. */
	// Setting game and graphics time.
	setGameTime(2);

	// Setting real time.
	realTime = baseTime;
	deltaRealTime = 0;
	realTimeFraction = 0.f;

	modifier = 1.0f;

	stopCount = 0;

	chosenLatency = GAME_TICKS_PER_UPDATE;
	discreteChosenLatency = GAME_TICKS_PER_UPDATE;
	wantedLatency = GAME_TICKS_PER_UPDATE;
	for (player = 0; player != MAX_PLAYERS; ++player)
	{
		wantedLatencies[player] = 0;
	}

	// Don't let syncDebug from previous games cause a desynch dump at gameTime 102.
	resetSyncDebug();
}
Beispiel #2
0
/* Call this to reset the game timer */
void gameTimeReset(UDWORD time)
{
	// reset the game timers
	setGameTime(time);
	gameTimeResetMod();
	realTime = wzGetTicks();
	deltaRealTime = 0;
}
Beispiel #3
0
// reset different game properties
void GameData::newGame() {
    setMoves(0);
    setP1Score(0);
    setP2Score(0);
    m_gameTimeSeconds = 0;
    setGameTime("0:00");
    foreach (Point *p, m_points) {
        p->setType(PLAYER_0);
        p->setCaptured(false);
    }
Beispiel #4
0
void GameData::updateTime()
{
    if (m_gameOn) m_gameTimeSeconds++;
    setGameTime(m_gameTime.addSecs(m_gameTimeSeconds).toString("m:ss"));
}