コード例 #1
0
void ObjectStateUpdateSystem::destroyPlayer( GameData& mGameData)
{
	Player * player = mGameData.getPlayer();
	if (player != NULL)
	{
		createExplosionFor(player, mGameData);
		player->setVisible(false);
	} else
	{
		throw My_Exception("Try to remove nonexistent player");
	}
}
コード例 #2
0
void ObjectStateUpdateSystem::updateShooting( GameData &mGameData )
{
	//creating bullets when player is shooting
	Player * player = mGameData.getPlayer();
	if (player != NULL)
	{
		serveShooting(player, mGameData);
	}

	//parsing through enemies
	GameCollectionIterator<EnemyObject> enemyIterator = mGameData.getEnemies().getIterator();
	EnemyObject* enemyIt;
	while (enemyIterator.hasNext())
	{
		enemyIt = enemyIterator.getNext();
		serveShooting(enemyIt, mGameData);
	}
}