Пример #1
0
//===================================
// verify if player is alive 
// according to the number
// of lives he has left
//===================================
bool Player::isPlayerAlive(){
	if (playerLives == 0){
		playerErase();
		playerPosition = Point(0, 0);
		playerAlive = false;
	}
	return playerAlive;
}
Пример #2
0
void PaintSubsystem::doAction(unsigned long currentTime) {
    for(PaintingType::iterator i = painting.begin(); i != painting.end();
        ++ i) {
        
        int id = (*i).first;
        Event::TogglePainting::PaintType type = (*i).second;
        
        // can't paint or erase when in the air
        if(!worldManager->getPlayer(id)->getOnGround()) continue;
        
        switch(type) {
        case Event::TogglePainting::ERASING:
			playerErase(worldManager->getPlayer(id));
			/*
            EMIT_EVENT(new Event::PaintEvent(
                worldManager->getPlayer(id)->getPosition(),
                PAINTING_RADIUS,
                -1));
			*/
            break;
        case Event::TogglePainting::PAINTING:
			playerPaint(worldManager->getPlayer(id));
			/*
            EMIT_EVENT(new Event::PaintEvent(
                worldManager->getPlayer(id)->getPosition(),
                PAINTING_RADIUS,
				worldManager->getPlayer(id)->getTeamID()));
            break;
			*/
        default:
        case Event::TogglePainting::NOTHING:
            break;
        }
    }
    
    calculateBoostSpeeds();
}