Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case Event::MouseButtonPressed:
- if(Event.mouseButton.button == Mouse::Left)
- {
- if(!htp1 or !htp2)
- {
- // ng
- if(mPosition.x >= ngPos.x and mPosition.x <= ngPos.x + 680)
- {
- if(mPosition.y >= ngPos.y and mPosition.y <= ngPos.y+84)
- {
- startGame = true;
- cout << "New game" << endl;
- }
- }
- // htp
- if(mPosition.x >= htpPos.x and mPosition.x <= htpPos.x + 837 )
- {
- if(mPosition.y >= htpPos.y and mPosition.y <= htpPos.y + 84)
- {
- cout << "How to play" << endl;
- htp1 = true;
- }
- }
- //exit
- if(mPosition.x >= exitPos.x and mPosition.x <= exitPos.x + 324 )
- {
- if(mPosition.y >= exitPos.y and mPosition.y <= exitPos.y + 81 )
- {
- cout << "EXIT ja" << endl;
- Window.close();
- }
- }
- // right arrow
- if(mPosition.x >= 1487 and mPosition.x <= 1789
- and mPosition.y >= 756 and mPosition.y <= 900)
- {
- if(htp1)
- {
- htp1 = false;
- htp2 = true;
- }
- else if(htp2)
- {
- htp2 = false;
- startGame = true;
- cout << "START GAME!!" << endl;
- }
- }
- // left arrow
- if(mPosition.x >= 244 and mPosition.x <= 547
- and mPosition.y >= 756 and mPosition.y <= 900)
- {
- if(htp1)
- htp1 = false;
- else if(htp2)
- {
- htp2 = false;
- htp1 = true;
- }
- }
- cout << mPosition.x << " " << mPosition.y << endl;
- }
- }
- break;
- case Event::MouseMoved:
- if(mPosition.x >= ngPos.x and mPosition.x <= ngPos.x + 680 and
- mPosition.y >= ngPos.y and mPosition.y <= ngPos.y+84)
- {
- newgame.setPosition(ngPos.x, ngPos.y - speed);
- }
- else newgame.setPosition(ngPos.x, ngPos.y);
- if(mPosition.x >= htpPos.x and mPosition.x <= htpPos.x + 837 and
- mPosition.y >= htpPos.y and mPosition.y <= htpPos.y + 84)
- {
- htp.setPosition(htpPos.x, htpPos.y - speed);
- }
- else htp.setPosition(htpPos.x,htpPos.y);
- if(mPosition.x >= exitPos.x and mPosition.x <= exitPos.x + 324 and
- mPosition.y >= exitPos.y and mPosition.y <= exitPos.y + 81 )
- {
- exit.setPosition(exitPos.x, exitPos.y - speed);
- }
- else exit.setPosition(exitPos.x, exitPos.y);
- // cout << mPosition.x << " " << mPosition.y << endl;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement