-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBlock.h
More file actions
52 lines (38 loc) · 844 Bytes
/
Block.h
File metadata and controls
52 lines (38 loc) · 844 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <vector>
#include "framework.h"
#include "SpriteSheet.h"
using namespace std;
class Block {
public:
friend Block* GetBlockBySymbol(char symbol);
friend Block* GetBlockByIndex(int index);
friend Block* GetBlockByCoords(UINT16 x, UINT16 y);
Block(LPCWSTR, Graphics*, char, bool, int, int = 0, int = 50);
~Block();
void Render(int x, int y, int offset);
int GetSeed();
int GetMaxGenerationHeight();
int GetIndex();
char GetSymbol();
bool IsCollisionEnabled();
Graphics* gfx;
enum blockIndexes {
stone = 0,
cave = 1,
air = 2,
grass = 3,
dirt = 4,
diamond = 5,
gold = 6,
};
private:
bool collisionEnabled;
char symbol;
int maxGeneratingHeight;
int seed;
int index;
SpriteSheet* sprites;
static const inline int spriteWidth = 32;
static const inline int spriteHeight = 32;
};