Beispiel #1
0
void Game::draw(sf::RenderWindow* window)
{
	/*//if(playerLives==0)
	{ //
	*///}
	switch (state)
	{
		case(LEVEL_ONE):

			if(levelLoaded==false)
			{
				LoadLevel(window,"level.dat");
			}
			break;
		case(LEVEL_TWO):
			if(levelCleared==true)
			{
			clearLevel();
			levelLoaded=false;
			}
			if(levelLoaded==false)
			{
				LoadLevel(window,"levelTwo.dat");
				//levelLoaded=true;
				level2Cleared=true;
			}
		break;
		case(GAME_OVER):
			{
			endGame(window);
			printf("REACHED GAME OVER STAGE");
			}
	}

	GameWindow->Clear( sf::Color( 255, 255, 255 ) );
	GameWindow->Draw(backGroundSprite);

	Player1->draw();
	beetle->draw();

	for(vector<Block*>::iterator i= blockVec.begin();i!=blockVec.end();i++)//Iterator that goes through the vector of blocks
	{
		(*i)->draw();
	}
	for(vector<Gem*>::iterator i= gemVec.begin();i!=gemVec.end();i++)//Iterator that goes through the vector of GEMS
	{
		(*i)->draw();
	}

	exit->draw();

	headsUpDisplay();
	GameWindow->Display();
	return;//Initialise sprites and draw them.
}
Beispiel #2
0
void draw2D(){ 
	headsUpDisplay(5, 15, 10);
}