예제 #1
0
bool FrameFunc()
{
	float dt = hge->Timer_GetDelta();
	if (hge->Input_GetKeyState(HGEK_ESCAPE)) return true;
	if (gameActive){
		for(int i=0;i < players.size(); i++){
			players.at(i)->Update(hge);
		}
		for(int i=0;i < enemies.size(); i++){
			enemies.at(i)->Update(hge);
		}
		CheckEnemyHits();
		CheckEnemyBounds();
		addPlayerTimer -= dt;
		if (addPlayerTimer < 0){
			AddPlayer();
			addPlayerTimer = 20;
		}
		addEnemyTimer -= dt;
		if (addEnemyTimer < 0){
			AddEnemy();
			addEnemyTimer = newEnemyTime + hge->Random_Float(0.0f,1.0f);
			if (newEnemyTime > 1.0f) newEnemyTime -= 0.1f;
		}
	}
	else
	{
		if (UpdateGUI(dt)) return true;
	}
	return false;
}
예제 #2
0
파일: Wave.cpp 프로젝트: kdittle/CPLUSPLUS
//Creates the wave of enemies
void Wave::CreateWave()
{
	//If the wave list isn't full, add enemies
	if (enemyCount < enemiesPerWave)
		AddEnemy();

	//If there are enough enemies, the wave is ready
	if (enemyCount >= enemiesPerWave)
		waveReady = true;
}
예제 #3
0
//-------------------------------------------------------------------------------------------------------------
// LoadEnemies : permite cargar los enemigos con sus propiedades individuales  y asociarles los componentes 
//			de física, lógica y renderizado
//-------------------------------------------------------------------------------------------------------------
bool CCharactersManager::LoadEnemiesProperties( const CXMLTreeNode &_Node )
{
	LOGGER->AddNewLog ( ELL_INFORMATION, "CCharactersManager::LoadEnemiesProperties-->Loading enemies and properties." );
	
	bool l_IsOk = true;
	int  l_NextIDValid = m_pPlayer->GetID() + 1;

	CXMLTreeNode l_EnemiesNode = _Node;
	std::string l_Type = l_EnemiesNode.GetName();		// Les propietats van primer
	if( l_Type == "enemies" )
	{
		uint16 l_Count = l_EnemiesNode.GetNumChildren();
		for ( uint16 i = 0; i < l_Count; ++i )
		{
			l_Type = l_EnemiesNode(i).GetName();
			if (  l_Type == "enemy" )
			{
				CProperties* l_EnemyProperties = m_pPropertiesManager->LoadEnemyProperties( l_EnemiesNode(i) ); 
				if ( l_EnemyProperties )
				{
					CCharacter* l_Character = GetResource( l_EnemyProperties->GetName() );
					CEnemy* l_Enemy = NULL;
					if ( !l_Character )
						l_Enemy = new CEnemy(l_NextIDValid);
					else
						l_Enemy = dynamic_cast<CEnemy*> (l_Character);

					l_Enemy->SetProperties ( l_EnemyProperties );
					l_Enemy->Init();
					AddEnemy ( l_Enemy );
					l_NextIDValid += 1;
					l_IsOk = true;
				}
				else 
				{
					std::string msg_error = "CCharactersManager::LoadEnemiesProperties--> Error when trying to load enemy properties : " + l_Type;
					LOGGER->AddNewLog( ELL_ERROR, msg_error.c_str() );
					l_IsOk = false;
				}
			}
			else if ( l_Type != "comment" ) 
			{
				std::string msg_error = "CCharactersManager::LoadEnemiesProperties--> Error, it cannot read the command line : " + l_Type;
				LOGGER->AddNewLog( ELL_ERROR, msg_error.c_str() );
			}
		}
	}
	else 
	{
		std::string msg_error = "CCharactersManager::LoadEnemiesProperties --> Error when trying to load enemies properties : " + l_Type;
		LOGGER->AddNewLog( ELL_ERROR, msg_error.c_str() );
		return false;
	}
	return l_IsOk;
}
예제 #4
0
void CEnemyManager::Load(const std::string &Filename)
{
	CXMLTreeNode l_File;
	if(l_File.LoadFile(Filename.c_str()))
	{
		CXMLTreeNode  l_Enemies=l_File["enemies"];
		if(l_Enemies.Exists())
		{	
			int l_Count= l_Enemies.GetNumChildren();
			for(int i = 0; i <l_Count; ++i)
				AddEnemy(l_Enemies(i));
		}
	}
}
예제 #5
0
void Stage01::AddEnemy003(int startFrame)
{
	auto engine = STGEngine::GetInstance();
	if (frame == startFrame)
	{
		Ptr<Enemy01_003> enemy = Ptr<Enemy01_003>::New();
		enemy->SetPosition(192, 500);
		Ptr<TweenSequence> sequence = Ptr<TweenSequence>::New();
		sequence->AddTween(Ptr<MoveTo>::New(Vector3f(192, 320, enemy->GetPosition().z), 120, Tweener::SIMPLE).Get());
		sequence->AddTween(Ptr<Delay>::New(500).Get());
		sequence->AddTween(Ptr<MoveTo>::New(Vector3f(192, 500, enemy->GetPosition().z), 180, Tweener::SIMPLE).Get());
		enemy->AddTween(sequence.Get());
		engine->AddEnemy(enemy.Get());
	}
}
예제 #6
0
void Stage01::AddEnemy002(int startFrame)
{
	auto engine = STGEngine::GetInstance();
	int frame2 = frame - startFrame;
	const int interval = 30;
	if (frame2 < 80 && frame2 % 10 == 1)   //frame == 1,11,21,...71
	{
		int i = frame2 / 10;
		Ptr<Enemy01_002> enemy = Ptr<Enemy01_002>::New();
		enemy->SetPosition(414, 420);
		Ptr<TweenSequence> sequence = Ptr<TweenSequence>::New();
		sequence->AddTween(Ptr<MoveTo>::New(Vector3f(192 + interval * (i - 3.5), 280,
			enemy->GetPosition().z), 120, Tweener::EASE_OUT).Get());
		sequence->AddTween(Ptr<Delay>::New(60).Get());
		sequence->AddTween(Ptr<MoveTo>::New(Vector3f(-36, 140, enemy->GetPosition().z), 120, Tweener::EASE_IN).Get());
		enemy->AddTween(sequence.Get());
		engine->AddEnemy(enemy.Get());
	}
}
예제 #7
0
파일: ai.cpp 프로젝트: bellinat0r/Epiar
/**\brief sets the AI's target
 *
 */
void AI::SetTarget(int t){
	AddEnemy(t,0);
	target=t;
}
예제 #8
0
bool CApp::FrameFunc( )
{
    if( iLife <= 0 )
    {
        w_Window.setTitle( "Game Over" );
    }
    else
    {
        fSpawnTimer += 0.1f;
        if( fSpawnTimer >= 10 )
        {
            fSpawnTimer = rand( ) % 800 / 100;
            AddEnemy( 900, 100 + rand( ) % 500, 2.5f + float( ( rand( ) % 30 ) ) / 10.0f );
        }

        for( auto it : o_Object )
        {
            it->Update( );
            if( it->x < 0 )
            {
                o_Object.remove( it );
                iLife--;
                char cTmp[20];
                sprintf( cTmp, "Lifes: %d", iLife );
                w_Window.setTitle( cTmp );
                break;
            }
            if( it->x > 950 )
            {
                o_Object.remove( it );
                break;
            }

            bool bDeleted = false;
            for( auto it2 : o_Object )
            {
                if( it->sfr.intersects( it2->sfr ) && it->sfr != it2->sfr )
                {
                    o_Object.remove( it2 );
                    bDeleted = true;
                    break;
                }
            }
            if( bDeleted )
            {
                o_Object.remove( it );
                break;
            }
        }
    }

    static float fReload = 0;

    if ( sf::Keyboard::isKeyPressed( sf::Keyboard::Space ) && fReload <= 0 )
    {
        AddBullet( sf::Mouse::getPosition( ).x, sf::Mouse::getPosition( ).y );
        fReload = 1.5f;
    }

    fReload -= 0.1f;

    if( sf::Keyboard::isKeyPressed( sf::Keyboard::Escape ) )
        return false;
    return true;
}
예제 #9
0
/*
updateScene checks all the object that is inside the scene and updates the scene manager accordingly.
The idea behind it is to use spatial partition to manage scene nodes and objects in the game.
Load the objects when they come into load radius, unload them when they get out of the hold radius.
*/
void MapManager::UpdateScene(void)
{
	//first of all update our loaded list
	UpdateLoadedList(&mFullyLoadedAreaList);

	//go through the enemy list, see if we need to remove any it from the scene
	std::vector<EnemyAI*>::iterator enemyIterator;
	for(enemyIterator = mEnemyList.begin(); enemyIterator != mEnemyList.end(); enemyIterator++)
	{
		//check if this enemy position is too far from our player
		Ogre::Real displacement = (*enemyIterator)->mEnemy->getPosition().distance(mPlayerNode->getPosition());
		if(displacement > ENEMY_HOLDRADIUS)
		{
			//the enemy is outside hold radius
			//remove it
			if((*enemyIterator)->mSpells.empty() == false)
			{
				unsigned int i = 0;
				while(i < (*enemyIterator)->mSpells.size())
				{
					//spell died
					BaseSpell *PointSpell = (*enemyIterator)->mSpells[i];
					PointSpell->kill(Ogre::Root::getSingletonPtr()->getSceneManager("JixLeePuff"));
					(*enemyIterator)->mSpells.erase((*enemyIterator)->mSpells.begin() + i);
					delete PointSpell;

					i++;
				}
			}
			(*enemyIterator)->mEnemy->kill();
			mEnemyList.erase(enemyIterator);
			break;
		}
	}

	//then check if map are still at the safe zone of the map.
	//meaning we do not worry about moving into a new map which requires a lot of things to do

	//has our character cross over to another map?
	//North
	if(mPlayerNode->getPosition().z < mMapTree->getCurrentMap()->getStartingPosition().z)
	{
		mMapTree->traverse(NORTH);
	}
	//South
	if(mPlayerNode->getPosition().z > mMapTree->getCurrentMap()->getEndingPosition().z)
	{
		mMapTree->traverse(SOUTH);
	}
	//East
	if(mPlayerNode->getPosition().x > mMapTree->getCurrentMap()->getEndingPosition().x)
	{
		mMapTree->traverse(EAST);
	}
	//West
	if(mPlayerNode->getPosition().x < mMapTree->getCurrentMap()->getStartingPosition().x)
	{
		mMapTree->traverse(WEST);
	}

	//clear surrounding area list if it is not empty
	if(!mSurroundingAreaList.empty())
		mSurroundingAreaList.clear();

	//first check to see if the player's load radius has reach beyond the borders of the current map
	//check one by one

	//North
	if((static_cast<int>(mPlayerNode->getPosition().z) - LOADRADIUS) < mMapTree->getCurrentMap()->getStartingPosition().z)
	{
		//yes!
		//get the list of areas been affected in that map
		Map* temp = mMapTree->getDirectionedMap(NORTH);
		tempAreaList = temp->GetAllFullAffectingArea(mPlayerNode->getPosition());
		//combine the temp area list into surrounding area list
		CombineVectorList(&tempAreaList, &mSurroundingAreaList);
	}
	//South
	if((static_cast<int>(mPlayerNode->getPosition().z) + LOADRADIUS) > mMapTree->getCurrentMap()->getEndingPosition().z)
	{
		//yes!
		Map* temp = mMapTree->getDirectionedMap(SOUTH);
		tempAreaList = temp->GetAllFullAffectingArea(mPlayerNode->getPosition());
		CombineVectorList(&tempAreaList, &mSurroundingAreaList);
	}
	//West
	if((static_cast<int>(mPlayerNode->getPosition().x) - LOADRADIUS) < mMapTree->getCurrentMap()->getStartingPosition().x)
	{
		//yes!
		Map* temp = mMapTree->getDirectionedMap(WEST);
		tempAreaList = temp->GetAllFullAffectingArea(mPlayerNode->getPosition());
		CombineVectorList(&tempAreaList, &mSurroundingAreaList);
	}
	//East
	if((static_cast<int>(mPlayerNode->getPosition().x) + LOADRADIUS) > mMapTree->getCurrentMap()->getEndingPosition().x)
	{
		//yes!
		Map* temp = mMapTree->getDirectionedMap(EAST);
		tempAreaList = temp->GetAllFullAffectingArea(mPlayerNode->getPosition());
		CombineVectorList(&tempAreaList, &mSurroundingAreaList);
	}
	
	//second check if we need to add or remove our objects in the scene

	//check if there are new areas come into load radius
	//get a new list
	//update the loading list
	mLoadingAreaList = mMapTree->getCurrentMap()->GetAllFullAffectingArea(mPlayerNode->getPosition());

	//combine the surrounding area list into loading area list
	CombineVectorList(&mSurroundingAreaList, &mLoadingAreaList);

	//check if the list is empty
	if(!mLoadingAreaList.empty())
	{
		//no we receive a new list of areas
		//first add those objects inside
		std::vector<MapArea*>::iterator newAreaIterator;

		for(newAreaIterator=mLoadingAreaList.begin(); newAreaIterator!=mLoadingAreaList.end(); newAreaIterator++)
		{
			//just incase this area is actually already loaded
			if((*newAreaIterator)->isLoaded())
				continue;

			//create a scene node for the area
			char areaString[20];
			sprintf(areaString, "map_area_%d", (*newAreaIterator)->getIndex());

			//create a node for every area
			Ogre::SceneNode* areaNode = mMapNode->createChildSceneNode(Ogre::String(areaString));

			(*newAreaIterator)->setLoaded(true);

			//add the ground into the node.
			char groundString[30];
			sprintf(groundString, "map_area_ground_%d", (*newAreaIterator)->getIndex());
			Ogre::SceneNode* groundNode = areaNode->createChildSceneNode(groundString);
			groundNode->attachObject((*newAreaIterator)->getGroundEntity());
			groundNode->setPosition((*newAreaIterator)->getCenterPosition());

			//now we need to go through the objects to find out which object has to be removed from it
			std::vector<Objects*>::iterator obstacleIterator;
			for(obstacleIterator = (*newAreaIterator)->_mObstacleList.begin(); obstacleIterator!=(*newAreaIterator)->_mObstacleList.end(); obstacleIterator++)
			{
				//is this object inside the load radius?
				if(IsObjectInsideRadius((*obstacleIterator), LOADRADIUS))
				{
					AddObstacle((*newAreaIterator), (*obstacleIterator));
				}
			}

			std::vector<Objects*>::iterator enemyIterator;
			for(enemyIterator = (*newAreaIterator)->_mEnemySpawnPointList.begin(); enemyIterator!=(*newAreaIterator)->_mEnemySpawnPointList.end(); enemyIterator++)
			{
				//no
				//is this object inside the load radius?
				if(IsObjectInsideRadius((*enemyIterator), ENEMY_LOADRADIUS))
				{
					AddEnemy((*enemyIterator));
				}
			}

			std::vector<Objects*>::iterator flamethrowerIterator;
			for(flamethrowerIterator = (*newAreaIterator)->_mFlameThrowerList.begin(); flamethrowerIterator!=(*newAreaIterator)->_mFlameThrowerList.end(); flamethrowerIterator++)
			{
				//no
				//is this object inside the load radius?
				if(IsObjectInsideRadius((*flamethrowerIterator), ENEMY_LOADRADIUS))
				{
					AddFlameThrower((*flamethrowerIterator));
				}
			}

			//then we add the areas inside the list to our fully loaded list
			mFullyLoadedAreaList.push_back((*newAreaIterator));
		}
		
	}
}
예제 #10
0
//update that checks the loaded list for adding or removing objects inside
void MapManager::UpdateLoadedList(std::vector<MapArea*> *input)
{
	//run through our current list
	//see if there is anything in the list to be updated
	std::vector<MapArea*>::iterator loadedIterator;
	for(loadedIterator = input->begin(); loadedIterator != input->end(); loadedIterator++)
	{
		//No matter if the area is fully inside or not, let's check if the area is now outside of the HOLDRADIUS
		if(!IsAreaInsideLoadRadius((*loadedIterator)))
		{
			if(!IsAreaInsideHoldRadius((*loadedIterator)))
			{
				//now, time to remove the area node
				//std::cout << "REMOVING AREA NODE!\n";
				char areaString[30];
				sprintf(areaString, "map_area_%d", (*loadedIterator)->getIndex());

				//get the area node from map node.
				Ogre::SceneNode* areaNode = (Ogre::SceneNode*)mMapNode->getChild(Ogre::String(areaString));

				//delete ground node
				char groundString[30];
				sprintf(groundString, "map_area_ground_%d", (*loadedIterator)->getIndex());

				Ogre::SceneNode* groundNode = (Ogre::SceneNode*)areaNode->getChild(Ogre::String(groundString));

				groundNode->removeAndDestroyAllChildren();
				groundNode->detachAllObjects();

				areaNode->removeAndDestroyChild(groundString);

				areaNode->removeAndDestroyAllChildren();
				areaNode->detachAllObjects();
				
				mMapNode->removeAndDestroyChild(areaString);

				//set the map area to be unloaded
				(*loadedIterator)->setLoaded(false);

				//remove it from the list
				input->erase(loadedIterator);
				return;
			}
		}

		//since this area is not fully inside, lets check if this object is currently inside the scene
		std::vector<Objects*>::iterator obstacleIterator;
		for(obstacleIterator = (*loadedIterator)->_mObstacleList.begin(); obstacleIterator!=(*loadedIterator)->_mObstacleList.end(); obstacleIterator++)
		{
			//is this object in the load radius?
			if(IsObjectInsideRadius((*obstacleIterator), LOADRADIUS))
			{
				//yes
				//is this object already loaded in the game?
				if((*obstacleIterator)->mLoaded)
				{
					//yes
					//skip
					continue;
				}
				else
				{
					//no
					//add it into the game
					AddObstacle((*loadedIterator), (*obstacleIterator));
				}
			}
			//is this object out of hold radius?
			else if(!IsObjectInsideRadius((*obstacleIterator), HOLDRADIUS))
			{
				//no
				//is this object already loaded in the game?
				if((*obstacleIterator)->mLoaded)
				{
					//yes
					//remove it
					RemoveObstacle((*loadedIterator),(*obstacleIterator));
				}
				else
				{
					//no
					//skip
					continue;
				}
			}
		}

		std::vector<Objects*>::iterator enemyIterator;
		for(enemyIterator = (*loadedIterator)->_mEnemySpawnPointList.begin(); enemyIterator!=(*loadedIterator)->_mEnemySpawnPointList.end(); enemyIterator++)
		{
			//is this object inside the load radius?
			if(IsObjectInsideRadius((*enemyIterator), ENEMY_LOADRADIUS))
			{
				//yes
				//is this enemy spawn point already loaded?
				if(!(*enemyIterator)->mLoaded)
				{
					//no
					//add enemy
					AddEnemy((*enemyIterator));
				}
			}
		}

		std::vector<Objects*>::iterator flamethrowerIterator;
		for(flamethrowerIterator = (*loadedIterator)->_mFlameThrowerList.begin(); flamethrowerIterator!=(*loadedIterator)->_mFlameThrowerList.end(); flamethrowerIterator++)
		{
			//no
			//is this object inside the load radius?
			if(!IsObjectInsideRadius((*flamethrowerIterator), ENEMY_LOADRADIUS))
			{
				//no
				//skip this object
				continue;
			}
			//yes continue whatever we need to do

			if(!(*flamethrowerIterator)->mLoaded)
				AddFlameThrower((*flamethrowerIterator));
		}
	}
}
예제 #11
0
/*
First time load the objects, only run once when we first create the map.
It will load all the objects that is around the player position.
Let's just assume we start at the center of a map.

If load game is to be implemented, TODO check surrounding maps using current position
*/
void MapManager::FirstLoadObjects(void)
{
	//first tell the map where we are and ask for the areas that is possibily affected

	//then we take the list of areas, add all the objects into our scene
	mFullyLoadedAreaList = mMapTree->getCurrentMap()->GetAllFullAffectingArea(mPlayerNode->getPosition());

	//add the objects in the list into the scene.
	std::vector<MapArea*>::iterator loadedIterator;
	for(loadedIterator = mFullyLoadedAreaList.begin(); loadedIterator != mFullyLoadedAreaList.end(); loadedIterator++)
	{
		char areaString[20];
		sprintf(areaString, "map_area_%d", (*loadedIterator)->getIndex());

		//create a node for every area
		Ogre::SceneNode* areaNode = mMapNode->createChildSceneNode(Ogre::String(areaString));

		(*loadedIterator)->setLoaded(true);

		//add the ground into the node.
		char groundString[30];
		sprintf(groundString, "map_area_ground_%d", (*loadedIterator)->getIndex());
		Ogre::SceneNode* groundNode = areaNode->createChildSceneNode(groundString);
		groundNode->attachObject((*loadedIterator)->getGroundEntity());
		groundNode->setPosition((*loadedIterator)->getCenterPosition());

		//run through the obstacle list
		std::vector<Objects*>::iterator obstacleIterator;
		for(obstacleIterator = (*loadedIterator)->_mObstacleList.begin(); obstacleIterator!=(*loadedIterator)->_mObstacleList.end(); obstacleIterator++)
		{
			//no
			//is this object inside the load radius?
			if(!IsObjectInsideRadius((*obstacleIterator), LOADRADIUS))
			{
				//no
				//skip this object
				continue;
			}
			//yes continue whatever we need to do
	
			AddObstacle((*loadedIterator), (*obstacleIterator));
		}

		std::vector<Objects*>::iterator enemyIterator;
		for(enemyIterator = (*loadedIterator)->_mEnemySpawnPointList.begin(); enemyIterator!=(*loadedIterator)->_mEnemySpawnPointList.end(); enemyIterator++)
		{
			//no
			//is this object inside the load radius?
			if(!IsObjectInsideRadius((*enemyIterator), ENEMY_LOADRADIUS))
			{
				//no
				//skip this object
				continue;
			}
			//yes continue whatever we need to do
	
			AddEnemy((*enemyIterator));
		}

		std::vector<Objects*>::iterator flamethrowerIterator;
		for(flamethrowerIterator = (*loadedIterator)->_mFlameThrowerList.begin(); flamethrowerIterator!=(*loadedIterator)->_mFlameThrowerList.end(); flamethrowerIterator++)
		{
			//no
			//is this object inside the load radius?
			if(!IsObjectInsideRadius((*flamethrowerIterator), ENEMY_LOADRADIUS))
			{
				//no
				//skip this object
				continue;
			}
			//yes continue whatever we need to do
	
			AddFlameThrower((*flamethrowerIterator));
		}
	}
}
//Spawn Player
void snDungeon2::SpawnPlayer()
{
	//Add Player
	int random = rand() % 4;
	if (random == 0)
		App->game->player->SetPosition({ 1442, 1530 });
	else if (random == 1)
		App->game->player->SetPosition({ 120, 2169 });
	else if (random == 2)
		App->game->player->SetPosition({ -1262, 3101 });
	else if (random == 3)
		App->game->player->SetPosition({ -2340, 1961 });

	//Add Boss
	int random2 = rand() % 4;
	while (random2 == random)
	{
		random2 = rand() % 4;
	}
	Entity* to_add = NULL;
	iPoint pos;
	if (random2 == 0)
	{
		pos = { 1442, 1530 };
		to_add = AddBoss(pos);
		entity_list.push_back(to_add);
	}	
	else if (random2 == 1)
	{
		pos = { 120, 2169 };
		to_add = AddBoss(pos);
		entity_list.push_back(to_add);
	}	
	else if (random2 == 2)
	{
		pos = { -1262, 3101 };
		to_add = AddBoss(pos);
		entity_list.push_back(to_add);
	}	
	else if (random2 == 3)
	{
		pos = { -2340, 1961 };
		to_add = AddBoss(pos);
		entity_list.push_back(to_add);
	}
	
	//Add Enemies 1
	if (random != 0 && random2 != 0)
	{
		pos = { 109, 40 };
		for (int i = 0; i < 3; i++)
		{
			for (int i = 0; i < 2; i++)
			{
				to_add = AddEnemy(pos);
				entity_list.push_back(to_add);
				pos.y += 3;
			}
			pos.x += 2;
			pos.y = 40;
		}
	}
	if (random != 1 && random2 != 1)
	{
		pos = { 105, 102 };
		for (int i = 0; i < 3; i++)
		{
			for (int i = 0; i < 2; i++)
			{
				to_add = AddEnemy(pos);
				entity_list.push_back(to_add);
				pos.y += 3;
			}
			pos.x += 2;
			pos.y = 102;
		}
	}
		
	if (random != 2 && random2 != 2)
	{
		pos = { 120, 182 };
		for (int i = 0; i < 3; i++)
		{
			for (int i = 0; i < 2; i++)
			{
				to_add = AddEnemy(pos);
				entity_list.push_back(to_add);
				pos.y += 3;
			}
			pos.x += 2;
			pos.y = 182;
		}
	}
	if (random != 3 && random2 != 3)
	{
		pos = { 35, 153 };
		for (int i = 0; i < 3; i++)
		{
			for (int i = 0; i < 2; i++)
			{
				to_add = AddEnemy(pos);
				entity_list.push_back(to_add);
				pos.y += 3;
			}
			pos.x += 2;
			pos.y = 153;
		}
	}

	//Add Enemies 2
	pos = { 109, 123 };
	for (int i = 0; i < 2; i++)
	{
		for (int i = 0; i < 2; i++)
		{
			to_add = AddEnemy(pos);
			entity_list.push_back(to_add);
			pos.y += 4;
		}
		pos.x += 3;
		pos.y = 123;
	}

	pos = { 117, 153 };
	for (int i = 0; i < 2; i++)
	{
		for (int i = 0; i < 2; i++)
		{
			to_add = AddEnemy(pos);
			entity_list.push_back(to_add);
			pos.y += 4;
		}
		pos.x += 3;
		pos.y = 153;
	}

	pos = { 62, 182 };
	for (int i = 0; i < 2; i++)
	{
		for (int i = 0; i < 2; i++)
		{
			to_add = AddEnemy(pos);
			entity_list.push_back(to_add);
			pos.y += 4;
		}
		pos.x += 3;
		pos.y = 182;
	}

	pos = { 178, 46 };
	for (int i = 0; i < 2; i++)
	{
		for (int i = 0; i < 2; i++)
		{
			to_add = AddEnemy(pos);
			entity_list.push_back(to_add);
			pos.y += 4;
		}
		pos.x += 3;
		pos.y = 46;
	}

	//Add Enemies 3
	//Y lines
	pos = { 109, 67 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.y += 4;
	}

	pos = { 61, 142 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.y += 4;
	}

	pos = { 185, 70 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.y += 4;
	}

	//X lines
	pos = { 87, 177 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}

	pos = { 191, 125 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}

	pos = { 144, 33 };
	for (int i = 0; i < 3; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}

	//Add Enemies 4
	pos = { 77, 121 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 79, 124 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 95, 155 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 97, 158 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 142, 155 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 144, 158 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 166, 141 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 168, 144 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 153, 105 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 155, 108 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 178, 105 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 180, 108 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 150, 73 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 152, 76 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 68, 57 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 70, 60 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	pos = { 89, 35 };
	for (int i = 0; i < 2; i++)
	{
		to_add = AddEnemy(pos);
		entity_list.push_back(to_add);
		pos.x += 3;
	}
	pos = { 91, 38 };
	to_add = AddEnemy(pos);
	entity_list.push_back(to_add);

	//Items
	DropItem({ 380, 3118 });
	DropItem({ 1402, 2270 });
	DropItem({ 61, 1265 });
	DropItem({ -2182, 2524 });
	DropItem({ -701, 2083 });
	DropItem({ -1379, 2543 });

}