TestableHealthBar() :
     sut()
 {
     sut.set_dimensions(dimensions_);
     sut.set_position(position_);
 }
示例#2
0
文件: Game.hpp 项目: lemeshkob/Repo1
void RunGame()
{
	///////////// инициализация ///////////////////////////
	RenderWindow window(VideoMode(1366, 768), "The Game!", Style::Fullscreen);

	View view( FloatRect(0, 0, 450, 280) );

	Level lvl;
	lvl.LoadFromFile("files/Level2.tmx");

	Texture enemy_t, moveplatform_t, megaman_t, bullet_t, bg;
	bg.loadFromFile("files/images/bg.png");
	enemy_t.loadFromFile("files/images/enemy.png");
	moveplatform_t.loadFromFile("files/images/movingPlatform.png");
	megaman_t.loadFromFile("files/images/megaman.png");
	bullet_t.loadFromFile("files/images/bullet.png");


	AnimationManager anim;
	anim.loadFromXML("files/anim_megaman.xml",megaman_t);
	anim.animList["jump"].loop = 0;

	AnimationManager anim2;
	anim2.create("move",bullet_t,7,10,8,8,1,0);
	anim2.create("explode",bullet_t,27,7,18,18,4,0.01,29,false);

	AnimationManager anim3;
	anim3.create("move",enemy_t,0,0,16,16,2,0.002,18);
	anim3.create("dead",enemy_t,58,0,16,16,1,0);

	AnimationManager anim4;
	anim4.create("move",moveplatform_t,0,0,95,22,1,0);

    Sprite background(bg);
    background.setOrigin(bg.getSize().x/2,bg.getSize().y/2);

	std::list<Entity*>  entities;
	std::list<Entity*>::iterator it;

	std::vector<Object> e = lvl.GetObjects("enemy");
	for (int i=0;i < e.size();i++)
		entities.push_back(new ENEMY(anim3, lvl, e[i].rect.left, e[i].rect.top) );

	e = lvl.GetObjects("MovingPlatform");
	for (int i=0;i < e.size();i++)
		entities.push_back(new MovingPlatform(anim4, lvl, e[i].rect.left, e[i].rect.top) );

	Object pl = lvl.GetObject("player");
	PLAYER Mario(anim, lvl, pl.rect.left, pl.rect.top);

	HealthBar healthBar;

	Clock clock;

	/////////////////// основной цикл  /////////////////////
	while (window.isOpen())
	{
		float time = clock.getElapsedTime().asMicroseconds();
		clock.restart();

		time = time/500;  // здесь регулируем скорость игры

		if (time > 40) time = 40;

		Event event;
		while (window.pollEvent(event))
		{
			if (event.type == Event::Closed || Keyboard::isKeyPressed(Keyboard::Escape))
				window.close();

			if (event.type == Event::KeyPressed)
				if (event.key.code==Keyboard::Space)
		        	entities.push_back(new Bullet(anim2,lvl,Mario.x+18,Mario.y+18,Mario.dir) );
		}


		if (Keyboard::isKeyPressed(Keyboard::Left)) Mario.key["L"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Right)) Mario.key["R"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Up)) Mario.key["Up"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Down)) Mario.key["Down"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Space)) Mario.key["Space"]=true;


		for(it=entities.begin();it!=entities.end();)
		{
			Entity *b = *it;
			b->update(time);
			if (b->life==false)	{ it  = entities.erase(it); delete b;}
			else it++;
		}


		Mario.update(time);
		healthBar.update(Mario.Health);


		for(it=entities.begin();it!=entities.end();it++)
		{
			//1. враги
			if ((*it)->Name=="Enemy")
			{
				Entity *enemy = *it;

				if (enemy->Health<=0) continue;

				if  (Mario.getRect().intersects( enemy->getRect() ))
				    if (Mario.dy>0) { enemy->dx=0; Mario.dy=-0.2; enemy->Health=0;}
				    else if (!Mario.hit) { Mario.Health-=5; Mario.hit=true;
				                         if (Mario.dir) Mario.x+=10; else Mario.x-=10;}


				for (std::list<Entity*>::iterator it2=entities.begin(); it2!=entities.end(); it2++)
				{
					Entity *bullet = *it2;
					if (bullet->Name=="Bullet")
						if ( bullet->Health>0)
							if  (bullet->getRect().intersects( enemy->getRect() ) )
							 { bullet->Health=0; enemy->Health-=5;}
				}
			}

			//2. движущиеся платформы
			if ((*it)->Name=="MovingPlatform")
			{
			    Entity *movPlat = *it;
				if  (Mario.getRect().intersects( movPlat->getRect() ) )
				   if (Mario.dy>0)
					  if (Mario.y+Mario.h<movPlat->y+movPlat->h)
					  {Mario.y=movPlat->y - Mario.h + 3; Mario.x+=movPlat->dx*time; Mario.dy=0; Mario.STATE=PLAYER::stay;}
			}

			//3.. и т.д.
		}


		/////////////////////отображаем на экран/////////////////////
		view.setCenter( Mario.x,Mario.y);
		window.setView(view);

		background.setPosition(view.getCenter());
		window.draw(background);

		lvl.Draw(window);

		for(it=entities.begin();it!=entities.end();it++)
			(*it)->draw(window);

		Mario.draw(window);
		healthBar.draw(window);

		window.display();
	}


}
示例#3
0
文件: Game.hpp 项目: lemeshkob/Repo1
void RunGame()
{
	RenderWindow window(VideoMode(640, 480), "The Game!");
    menu(window);
	View view( FloatRect(0, 0, 450, 280) );

	Level lvl;
	int loadlevel = menu(window);


	//std::cout << "Which lvl would u prefer to load 1 or 2?\n";
	//std::cin >> loadlevel;

	switch(loadlevel){
    case 1:
        lvl.LoadFromFile("files/Level1.tmx");
        std::cout <<"\nLoaded lvl1";
        break;
    case 2:
        lvl.LoadFromFile("files/Level2.tmx");
        std::cout << "\nLoaded lvl2";
    default:
        system("exit");
        break;
	}


	Texture enemy_t, moveplatform_t, megaman_t, bullet_t, bg;
	bg.loadFromFile("files/images/bg.png");
	enemy_t.loadFromFile("files/images/enemy.png");
	moveplatform_t.loadFromFile("files/images/movingPlatform.png");
	megaman_t.loadFromFile("files/images/megaman.png");
	bullet_t.loadFromFile("files/images/bullet.png");


	AnimationManager anim;
	anim.loadFromXML("files/anim_megaman.xml",megaman_t);
	anim.animList["jump"].loop = 0;

	AnimationManager anim2;
	anim2.create("move",bullet_t,7,10,8,8,1,0);
	anim2.create("explode",bullet_t,27,7,18,18,4,0.01,29,false);

	AnimationManager anim3;
	anim3.create("move",enemy_t,0,0,16,16,2,0.002,18);
	anim3.create("dead",enemy_t,58,0,16,16,1,0);

	AnimationManager anim4;
	anim4.create("move",moveplatform_t,0,0,95,22,1,0);

    Sprite background(bg);
    background.setOrigin(bg.getSize().x/2,bg.getSize().y/2);

	std::list<Entity*>  entities;
	std::list<Entity*>::iterator it;

	std::vector<Object> e = lvl.GetObjects("enemy");
	for (int i=0;i < e.size();i++)
		entities.push_back(new ENEMY(anim3, lvl, e[i].rect.left, e[i].rect.top) );

	e = lvl.GetObjects("MovingPlatform");
	for (int i=0;i < e.size();i++)
		entities.push_back(new MovingPlatform(anim4, lvl, e[i].rect.left, e[i].rect.top) );

	Object pl = lvl.GetObject("player");
	PLAYER MegaMan(anim, lvl, pl.rect.left, pl.rect.top);

	HealthBar healthBar;

	Clock clock;
    int enemyCount = 0;
	/////////////////// основной цикл  /////////////////////
	while (window.isOpen())
	{



		float time = clock.getElapsedTime().asMicroseconds();
		clock.restart();

		time = time/500;  // здесь регулируем скорость игры

		if (time > 40) time = 40;

		Event event;
		while (window.pollEvent(event))
		{
			if (event.type == Event::Closed || Keyboard::isKeyPressed(Keyboard::Escape))
				window.close();

			if (event.type == Event::KeyPressed)
				if (event.key.code==Keyboard::Space)
		        	entities.push_back(new Bullet(anim2,lvl,MegaMan.x+18,MegaMan.y+18,MegaMan.dir) );
		}


		if (Keyboard::isKeyPressed(Keyboard::Left)) MegaMan.key["L"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Right)) MegaMan.key["R"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Up)) MegaMan.key["Up"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Down)) MegaMan.key["Down"]=true;
		if (Keyboard::isKeyPressed(Keyboard::Space)) MegaMan.key["Space"]=true;


		for(it=entities.begin();it!=entities.end();)
		{
			Entity *b = *it;
			b->update(time);
			if (b->life==false)	{ it  = entities.erase(it); delete b; enemyCount++; printf("\n%i", enemyCount);}
			else it++;

		}


		MegaMan.update(time);
		healthBar.update(MegaMan.Health);


        if(loadlevel == 2){
                            if(MegaMan.x > 355.0 && MegaMan.x < 450){
                                if(MegaMan.y < 345.0 && MegaMan.y > 320){
                                    MegaMan.Health = 0;
                                    MegaMan.hit=true;
                                }
                            }
                            if(MegaMan.x > 127 && MegaMan.x <548){
                                if(MegaMan.y <907 && MegaMan.y>875){
                                    MegaMan.Health = 0;
                                    MegaMan.hit=true;
                                }
                            }
                              if(MegaMan.x > 670 && MegaMan.x <1440){
                                if(MegaMan.y <907 && MegaMan.y>875){
                                    MegaMan.Health = 0;
                                    MegaMan.hit=true;
                                }
                            }
                                    if(MegaMan.Health == 0){

                                MegaMan.isDead();
                                death();
                                window.close();
                            }
                                }



		for(it=entities.begin();it!=entities.end();it++)
		{

			//1. враги
			if ((*it)->Name=="Enemy")
			{
				Entity *enemy = *it;


				if  (MegaMan.getRect().intersects( enemy->getRect() ))
				    if (MegaMan.dy>0) { enemy->dx=0; MegaMan.dy=-0.2; enemy->Health=0;}
				    else if (!MegaMan.hit) {
                            MegaMan.Health-=10; MegaMan.hit=true;

                            if(MegaMan.Health == 0){
                                MegaMan.isDead();
                                death();
                                window.close();
                            }
                if (MegaMan.dir){
                        MegaMan.x+=10;
                        } else{
                        MegaMan.x-=10;}
                }


				for (std::list<Entity*>::iterator it2=entities.begin(); it2!=entities.end(); it2++)
				{
					Entity *bullet = *it2;
					if (bullet->Name=="Bullet")
						if ( bullet->Health>0)
							if  (bullet->getRect().intersects( enemy->getRect() ) )
							 { bullet->Health=0; enemy->Health-=5;}
				}
			}

			//2. движущиеся платформы
			if ((*it)->Name=="MovingPlatform")
			{
			    Entity *movPlat = *it;
				if  (MegaMan.getRect().intersects( movPlat->getRect() ) )
				   if (MegaMan.dy>0)
					  if (MegaMan.y+MegaMan.h<movPlat->y+movPlat->h)
					  {MegaMan.y=movPlat->y - MegaMan.h + 3; MegaMan.x+=movPlat->dx*time; MegaMan.dy=0; MegaMan.STATE=PLAYER::stay;}
			}

			//3.. и т.д.
		}


		/////////////////////отображаем на экран/////////////////////
		view.setCenter( MegaMan.x,MegaMan.y);
		window.setView(view);

		background.setPosition(view.getCenter());
		window.draw(background);

		lvl.Draw(window);

		for(it=entities.begin();it!=entities.end();it++)
			(*it)->draw(window);

			if(loadlevel == 1){
                if(enemyCount >= 7 && MegaMan.x == 28 && MegaMan.y ==534){
                    window.close();
                    victory();
                }
			}
			 if(loadlevel == 2){
			  if(enemyCount == 5){
                window.close();
                victory();
			}
        }
		MegaMan.draw(window);
		healthBar.draw(window);
		window.display();

		//printf("%f %f\n",MegaMan.x, MegaMan.y);

	}


}
示例#4
0
int main()
{

	int state = 0;  //Menu

	cout << "Setting up SFML!" << endl;
    sf::RenderWindow window(sf::VideoMode(windowW, windowH), "Fighting Game", sf::Style::Close);
	sf::View view(sf::Rect<float>(0, 0, window.getSize().x, window.getSize().y));
	window.setView(view);

	

	cout << "Loading Menu backdrop" << endl;
	//Backdrops:
	sf::Texture menuBackTex = sf::Texture();
	if (!menuBackTex.loadFromFile("Resources/Backdrop/Island.png"))
	{
		cout << "Failed to load ISLAND menu background..." << endl;
	}
	else
	{
		cout << "Loaded!" << endl;
	}
	sf::Sprite menuBackSprite = sf::Sprite();
	menuBackSprite.setTexture(menuBackTex);
	menuBackSprite.setScale(2.f, 2.f);
	

	sf::Texture selectBackTex = sf::Texture();
	sf::Sprite selectBackSprite = sf::Sprite();
	selectBackSprite.setScale(2.f, 2.f);

	sf::Texture levelBackTex = sf::Texture();
	sf::Sprite levelBackSprite = sf::Sprite();
	//TEXTURES SHOULD NOT BE APPLIED:
	levelBackTex.loadFromFile("Resources/Backdrop/MountainRoad.png");
	levelBackSprite.setTexture(levelBackTex);
	levelBackSprite.setScale(2.f, 2.f);

	sf::Clock mouseClock = sf::Clock();

	window.setFramerateLimit(60);



	Player p = Player(SCALE, 400.f);
	Player p2 = Player(SCALE, 400.f);
	p.body.setPosition(25, 180);
	p2.body.setPosition(775, 180);
	p2.body.setScale(-p2.body.getScale().x, p2.body.getScale().y);

	bool loadPlayers = true;
	bool loadFrames = true;
	bool p2Selecting = false;

	int pID;
	int p2ID;

	HealthBar pBar = HealthBar(p.health);
	HealthBar p2Bar = HealthBar(p2.health);
	

	//Menu related:




	//Selected:
	//
	//0 = Play
	//1 = Options?
	//2 = Exit

	int selected = 0;  

	sf::Font font = sf::Font();
	
	font.loadFromFile("Resources/Font/8bitwonder.ttf");

	sf::Text playText = sf::Text();
	playText.setString("Play");
	playText.setFont(font);
	playText.setPosition(view.getSize().x / 2 - 40, view.getSize().y / 2 - 20);
	playText.setColor(sf::Color(255, 255, 255, 255));

	sf::Text exitText = sf::Text();
	exitText.setString("Exit");
	exitText.setFont(font);
	exitText.setPosition(view.getSize().x / 2 - 35, view.getSize().y / 2 + 60);
	exitText.setColor(sf::Color(255, 255, 255, 255));

	sf::Texture test = sf::Texture();
	test.loadFromFile("Resources/Player/Punch.png");
	

	sf::CircleShape selectTriangle = sf::CircleShape(18, 3);

	selectTriangle.setRotation(90.0f);
	
	sf::Time deltaTime;
	sf::Clock clock = sf::Clock();

	sf::Clock sinClock = sf::Clock();

	//Frames:
	sf::Texture presleyFrameTex;
	sf::Sprite presleyFrameSprite;

	sf::Texture gentlemanFrameTex;
	sf::Sprite gentlemanFrameSprite;

	bool isRunning = true;


	bool wasMousePressed = false;

    while (window.isOpen() && isRunning)
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
			switch (event.type)
			{
				case(sf::Event::Closed):
					window.close();
			}
			
        }	

		deltaTime = clock.restart();
		sf::RectangleShape indicator = sf::RectangleShape();
		//Game:
		if (state == 1)
		{
			if (loadPlayers)
			{
	
				cout << "Setting up players!" << endl;
				p.setup(0);
				p2.setup(0);
				loadPlayers = false;
				p.playAnim(1);
				p2.playAnim(0);

				p2Bar.body.setPosition(800.f - 250.f, 0.0f);
				p2Bar.fill.setPosition(800.f - 250.f, 0.0f);
			}


			p.update(deltaTime.asSeconds());
			p2.update(deltaTime.asSeconds());

			if (sf::Keyboard::isKeyPressed(sf::Keyboard::A) && p.canMove)
			{
				p.body.move(-p.velocity * deltaTime.asSeconds(), 0);
				p.playAnim(1);
				
				/*if (p2.facing == 0)
				{
				p2.body.setScale(-p.body.getScale().x, p.body.getScale().y);
				p.facing = 1;
				}*/
			}
			else if (sf::Keyboard::isKeyPressed(sf::Keyboard::D) && p.canMove)
			{
				p.body.move(p.velocity * deltaTime.asSeconds(), 0);
				p.playAnim(1);
				
				/*if (p2.facing == 1)
				{
				p2.body.setScale(-p.body.getScale().x, p.body.getScale().y);
				p.facing = 0;
				}*/
			}
			else
			{
				p.playAnim(0);
			}


			if (sf::Keyboard::isKeyPressed(sf::Keyboard::E))
			{
				p.punch(p2);
			}

			/*if (sf::Keyboard::isKeyPressed(sf::Keyboard::W))
			{
				p.body.move(0, -200 * deltaTime.asSeconds());
				p.body.setScale(p.body.getScale().x - 3.f * deltaTime.asSeconds(), p.body.getScale().x - 3.f * deltaTime.asSeconds());
			}
			if (sf::Keyboard::isKeyPressed(sf::Keyboard::S))
			{
				p.body.move(0, 200 * deltaTime.asSeconds());
				p.body.setScale(p.body.getScale().x + 3.f * deltaTime.asSeconds(), p.body.getScale().x + 3.f * deltaTime.asSeconds());
			}*/

			//P2:
			if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left) && p2.canMove)
			{
				p2.body.move(-p.velocity * deltaTime.asSeconds(), 0);
				p2.playAnim(1);
				/*if (p2.facing == 0)
				{
				p2.body.setScale(-p.body.getScale().x, p.body.getScale().y);
				p.facing = 1;
				}*/
			}
			else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right) && p2.canMove)
			{
				p2.body.move(p.velocity * deltaTime.asSeconds(), 0);
				p2.playAnim(1);
				/*if (p2.facing == 1)
				{
				p2.body.setScale(-p.body.getScale().x, p.body.getScale().y);
				p.facing = 0;
				}*/
			}
			else
			{
				p2.playAnim(0);
			}

			//ATACK:

			if (sf::Keyboard::isKeyPressed(sf::Keyboard::K))
			{
				p2.punch(p);
			}


			/*if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
			{
				p2.body.move(0, -200 * deltaTime.asSeconds());
				p2.body.setScale(p2.body.getScale().x - 3.f * deltaTime.asSeconds(), p2.body.getScale().x - 3.f * deltaTime.asSeconds());
			}
			if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
			{
				p2.body.move(0, 200 * deltaTime.asSeconds());
				p2.body.setScale(p2.body.getScale().x + 3.f * deltaTime.asSeconds(), p2.body.getScale().x + 3.f * deltaTime.asSeconds());
			}*/


			if (p2.body.getGlobalBounds().intersects(p.body.getGlobalBounds()))
			{
				/*p.speed = -200;
				p2.speed = 200;*/
				p.onCollision();
				p2.onCollision();
			}

			if (p.body.getPosition().x < 5)
			{
				p.body.setPosition(5, p.body.getPosition().y);
			}
			if (p2.body.getPosition().x > 790)
			{
				p2.body.setPosition(790, p2.body.getPosition().y);
			}
			window.clear();

			window.draw(levelBackSprite);

			

			if (p.body.getScale().x > p2.body.getScale().x)
			{
				p2.render(window);
				p.render(window);
			}
			else
			{
				p.render(window);
				p2.render(window);
			}

			pBar.update();
			window.draw(pBar.body);
			window.draw(pBar.fill);
			window.draw(p2Bar.body);
			window.draw(p2Bar.fill);

			window.display();
		}
		//Menu:
		else if (state == 0)
		{

			if (selected == 0)
			{
				selectTriangle.setPosition(playText.getPosition().x - 40, playText.getPosition().y + 3);
				if (sf::Keyboard::isKeyPressed(sf::Keyboard::S))
				{
					selected = 1;
				}
				if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
				{
					state = 2;
				}
				playText.setPosition(playText.getPosition().x, playText.getPosition().y + sin(-sinClock.getElapsedTime().asSeconds())/8);
				exitText.setPosition(view.getSize().x / 2 - 35, view.getSize().y / 2 + 60);
			}
			else if (selected == 1)
			{
				selectTriangle.setPosition(exitText.getPosition().x - 40, exitText.getPosition().y + 3);
				if (sf::Keyboard::isKeyPressed(sf::Keyboard::W))
				{
					selected = 0;
				}
				if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
				{
					isRunning = false;
				}
				exitText.setPosition(exitText.getPosition().x, exitText.getPosition().y + sin(-sinClock.getElapsedTime().asSeconds()) / 8);
				playText.setPosition(view.getSize().x / 2 - 40, view.getSize().y / 2 - 20);
			}

			window.clear();
			window.draw(menuBackSprite);
			window.draw(playText);
			window.draw(exitText);
			window.draw(selectTriangle);
			window.display();
		}
		//Player Select:
		else if (state == 2)
		{
			if (loadFrames)
			{

				cout << "Loading backdrop...";
				if (!selectBackTex.loadFromFile("Resources/Backdrop/SelectBack.png"))
				{
					cout << "Failed! " << endl;
				}
				else
				{
					cout << "Loaded!" << endl;
				}
				selectBackSprite.setTexture(selectBackTex);

				cout << "Loading frames..." << endl;

				cout << "Loading Presley's frame..";
				if (!presleyFrameTex.loadFromFile("Resources/Player/Frame.png"))
				{
					cout << "Failed to load texture " << endl;
				}
				else
				{
					cout << "Loaded!" << endl;
				}
				presleyFrameSprite.setTexture(presleyFrameTex);
				presleyFrameSprite.setScale(3.0f, 3.0f);
				presleyFrameSprite.setPosition(15.f, 15.f);
				loadFrames = false;
			}


			
			if (sf::Mouse::getPosition(window).x > presleyFrameSprite.getPosition().x - presleyFrameSprite.getOrigin().x &&
				sf::Mouse::getPosition(window).x < (presleyFrameSprite.getPosition().x +
				presleyFrameSprite.getGlobalBounds().width - presleyFrameSprite.getOrigin().x))
			{
				if (sf::Mouse::getPosition(window).y > presleyFrameSprite.getPosition().y - presleyFrameSprite.getOrigin().y &&
					sf::Mouse::getPosition(window).y < (presleyFrameSprite.getPosition().y - presleyFrameSprite.getOrigin().y +
					presleyFrameSprite.getGlobalBounds().height - presleyFrameSprite.getOrigin().y))
				{
					presleyFrameSprite.setScale(3.f + sin(sinClock.getElapsedTime().asSeconds()*10) / 10, 3.f + sin(sinClock.getElapsedTime().asSeconds()*10) / 10);
					if (sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
					{
						if (!wasMousePressed)
						{

							if (p2Selecting)
							{
								cout << "Player 2 selected. Starting game!" << endl;
								p2ID = 0;
								state = 1;
								p2Selecting = false;
							}
							else
							{
								cout << "Player 1 selected. Waiting for player 2!" << endl;
								pID = 0;
								p2Selecting = true;
							}
							if (sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
							{
								if (!wasMousePressed)
								{

									mouseClock.restart();
									wasMousePressed = true;
									cout << "Mouse wait..." << endl;
								}
							}

							
						}
					}
				}
			}
			else
			{
				presleyFrameSprite.setScale(3.f, 3.f);
			}

			window.clear();
			window.draw(selectBackSprite);
			window.draw(presleyFrameSprite);

			window.display();
		}

		if (wasMousePressed)
		{
			if (mouseClock.getElapsedTime().asMilliseconds() > 250)
			{
				cout << "Mouse restored!" << endl;
				wasMousePressed = false;
			}
		}
		//std::cout << deltaTime.asSeconds() << std::endl;
    }

    return 0;
}