Beispiel #1
0
// used by the editor
int CZone::DeleteNPC(int x, int y)
{
	for (unsigned int t=0;t<npcs.size();t++) {
		if ((npcs[t]->getXPos()+npcs[t]->getTexture( ActivityType::Walking )->getTexture( 1 ).width > x) &&
		        (npcs[t]->getXPos() < x)) {
			if ((npcs[t]->getYPos()+npcs[t]->getTexture( ActivityType::Walking )->getTexture( 1 ).height > y) &&
			        (npcs[t]->getYPos() < y)) {
				removeNPC( npcs[t] );
				return 0;
			}
		}
	}

	return 1;
}
Beispiel #2
0
void BattleScene::update(float dt)
{
	removeNPC();
	checkCollisionBombs();
	for (auto player: _players)
	{
		if (!player->isDestroy() && collisionNPCwithPlayer(player))
		{
			_control->showControlPlayer(player->getColorID(), false);
			player->dead();
		}
	}

	endGame();
}