-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpause.h
More file actions
29 lines (25 loc) · 926 Bytes
/
pause.h
File metadata and controls
29 lines (25 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//ïàóçà íà êàðòå
#include <SFML/Graphics.hpp>
#include <sftools/Chronometer.hpp>
#include <iostream>
#include "hp.h"
int appalive =10000000;
int *appaliv = &appalive;//ïåðåìåííàÿ äëÿ âûõîäà èç êàðòû â ïàóçå
void pausing(RenderWindow& app, sftools::Chronometer &clock4,Music* music)
{
Event event;
Texture t1;
t1.loadFromFile("images/BG.jpg");//çàãðóçêà êàðòèíêè èç ôàéëà
Sprite background(t1);
while(true)
{
app.clear();
app.draw(background);
Vector2f mouse_world = app.mapPixelToCoords(Mouse::getPosition(app));
if ((sf::Keyboard::isKeyPressed(Keyboard::Space))||(sf::Mouse::isButtonPressed(sf::Mouse::Left))||(sf::Mouse::isButtonPressed(sf::Mouse::Right))) break;
if (sf::Keyboard::isKeyPressed(Keyboard::Escape)) {appalive=0; break;}
app.display();
}
clock4.reset(true);
app.setActive(false);
}