-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrickgame.h
63 lines (52 loc) · 1.21 KB
/
brickgame.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include<iostream>
#include<SFML/Graphics.hpp>
#include<SFML/Audio.hpp>
#include<cstdlib>
#include<cstdio>
#include<set>
using namespace std;
using namespace sf;
class brickgame
{
private:
SoundBuffer buffer1, buffer2, buffer3;
Sound sound1, sound2, sound3;
Text data, close, gameover, restart, paused;
Font font;
int score;
int lives;
float time;
int high_score;
float window_width, window_height;
float board_width, board_height;
float brick_width, brick_height;
float ball_radius;
// MAKING AN OBJECT OF BOARD CLASS
Vector2f boardposition;
RectangleShape BOARD;
float boardspeed;
// EACH BRICK OBJECT
RectangleShape brick;
// MAKING AN OBJECT OF BALL CLASS
Vector2f ballposition;
CircleShape BALL;
float ballspeed_x;
float ballspeed_y;
float tempx, tempy;
// MAKING A SET TO STORE POSITIONS OF DESTROYED BRICKS
set< pair<int, int> > st;
// TO KNOW IF THE GAME IS PAUSED
bool ispaused;
public:
brickgame();
void set_font();
void set_text();
void set_sound();
void reset();
void pause();
void display(RenderWindow& window);
void move_board();
void handle_collison();
void drawing_scene(RenderWindow& window);
};