void CBGeoDataStream::startStream() { this->isRunning = true; this->timer = new QTimer(this); QObject::connect(timer, SIGNAL(timeout()), this, SLOT(retrievePoints())); this->timer->setInterval(CBGEODATASTREAM_UPDATE_SPEED); this->timer->start(); }
bool MediumPlane::damage(int damageReceived, bool wasShoot, Player* damager) { bool killed = false; //Daña al avion m_health -= damageReceived; m_soundSendId = true; m_soundSendId = 52; if (damager && wasShoot) { damager->incrementHitsStats(1); Game::Instance()->addPointsToScore(m_pointOnHit, damager->getObjectId(), damager->getPlayerTeam().gameTeamID); PopUp* pointsPopUp = new PointsPopUp(damager->getObjectId(), m_pointOnHit); pointsPopUp->load(m_position.m_x + m_width/2, m_position.m_y + m_height/2, 96, 16, 104, 1); Game::Instance()->addPopUp(pointsPopUp); } if (damager) { updateKillerStats(damager->getObjectId(), damageReceived); } //Si lo mato suma puntos al player que lo mato if (m_health <= 0) { m_soundSendId = 53; m_dying = true; explote(); if (canRetrievePoints() && damager) { int points = retrievePoints(); Game::Instance()->addPointsToScore(points, damager->getObjectId(), damager->getPlayerTeam().gameTeamID); damager->incrementEnemiesKilledStats(1); PopUp* pointsPopUp = new PointsPopUp(damager->getObjectId(), points); pointsPopUp->load(m_position.m_x + m_width/2, m_position.m_y + m_height/2, 96, 16, 104, 1); Game::Instance()->addPopUp(pointsPopUp); } } return killed; }