-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tile.h
48 lines (34 loc) · 848 Bytes
/
Tile.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
#ifndef TILE_H
#define TILE_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "MyTexture.h"
#include "Renderable.h"
class LGame;
// The tile
class Tile : public Renderable
{
public:
// Initializes position and id
Tile(LTexture &myTexture, LGame &game, int x, int y, int width, int height, int tileID);
// Shows the tile
int render(SDL_Renderer *renderer, SDL_Rect &camera);
// Get the tile id
int getID();
void setType( int type ) ;
int getType( ) ;
// get the tile
// Get the collision box
SDL_Rect getBox();
void cleanUp();
private:
// The attributes of the tile
SDL_Rect mBox;
LTexture &mTexture;
LGame &mGame;
// The tile id from map
int mID;
// tells the type of each tile ie which entity does it belong to
int mType ;
};
#endif