forked from kroyee/SpeedBlocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameField.h
62 lines (44 loc) · 1.18 KB
/
gameField.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
#ifndef GAMEFIELD_H
#define GAMEFIELD_H
#include <SFML/Graphics.hpp>
class gameField {
public:
sf::Uint8 square[22][10];
sf::RenderTexture texture;
sf::Sprite sprite;
sf::Sprite* tile;
sf::Sprite* background;
sf::Text nameTag;
sf::Text awayText;
sf::Text positionText;
sf::String name;
gameField(sf::Sprite* tilep, sf::Sprite* backgroundp);
gameField(const gameField& field);
void clear();
void drawField();
sf::Sprite* getSprite() { return &sprite; }
void setsquare(short y, short x, short color) { square[y][x] = color; }
short getsquare(short y, short x) { return square[y][x]; }
void removeline(short y);
sf::Vector2i clearlines();
void setName(const sf::String& n, const sf::Font& font);
};
class obsField : public gameField {
public:
obsField(const obsField& field);
obsField(sf::Sprite* tilep, sf::Sprite* backgroundp);
sf::Uint16 id;
short nextpiece;
short nprot;
short npcol;
short scale;
short posX, posY;
sf::Uint8 grid[4][4];
bool mouseover;
sf::Uint8 datacount;
bool away;
sf::Uint8 position;
void drawField();
void preDrawField();
};
#endif