-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTilemap.h
More file actions
77 lines (69 loc) · 2.22 KB
/
Tilemap.h
File metadata and controls
77 lines (69 loc) · 2.22 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include <SFML\Graphics.hpp>
#include <vector>
#include <fstream>
#include <string>
#include <sstream>
#include <iostream>
#include "Global_classes\Log.h"
class Tilemap
{
private:
int m_height;
int m_width;
int m_colwidth;
const int mt_height;
const int mt_width;
std::vector <char> m_tilemap;
std::vector<char> m_tilecollision;
int m_right;
int m_bottom;
//sf::Texture mt_tilemap[10];
//sf::Sprite ms_tilemap[10];
std::vector<sf::Texture*> texture_tilemapList;
std::vector<sf::Sprite> sprite_tilemapList;
public:
Tilemap();
~Tilemap();
/*******************************************/
/* function: void loadMap() */
/* description: this funktion load the */
/* tilemap */
/* */
/* param: */
/* return: */
/* Autor: Moritz Weichert */
/*******************************************/
void loadMap();
/*******************************************/
/* function: void loadGraphic() */
/* description: this funktion load the */
/* graphics for the tilemap */
/* */
/* param: */
/* return: */
/* Autor: Moritz Weichert */
/*******************************************/
void loadGraphic(std::string name);
/*******************************************/
/* function: void drawMap() */
/* description: this funktion draw's */
/* the tilemap */
/* */
/* param: RenderWindow */
/* return: */
/* Autor: Moritz Weichert */
/*******************************************/
void drawMap(sf::RenderWindow &win,float px, float py);
/*************************************************/
/* function: void isWalkable() */
/* description: this funktion check */
/* if the sprite collide with something */
/* */
/* param: left, top, width, height of the player */
/* return: bool */
/* Autor: Moritz Weichert */
/* Modified by: Dennis Klapper */
/*************************************************/
int isWalkable(int left, int top,int width,int height);
};