-
Notifications
You must be signed in to change notification settings - Fork 0
/
Level.h
51 lines (41 loc) · 1.04 KB
/
Level.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
#ifndef LEVEL_H
#define LEVEL_H
#include <SFML/Graphics.hpp>
#include "GameObject.h"
#include <iostream>
class Level : public GameObject {
public:
enum Block { Ground, Air, DownPassage, UpPassage, Note, Smear };
static const int ADVANCE_LEVEL = 1;
static const int RETURN_LEVEL = 2;
static const int OPEN_NOTE = 3;
private:
void updateFgAt(int,int);
void updateBgAt(int,int);
int portalAccessed;
int noteAccessed;
sf::Vector2f downLoc;
sf::Vector2f upLoc;
sf::RenderTexture bg;
sf::RenderTexture fg;
Block* space;
float gridSize;
int width;
int height;
int noteID;
public:
Level(int);
Level(std::istream&);
sf::Vector2f getPixelSize();
int logic();
bool colAt(float,float);
void activateAt(float,float);
void serialize(std::ostream&);
int getNoteID();
sf::Sprite getFG();
sf::Sprite getBG();
sf::Vector2f getDownLoc();
sf::Vector2f getUpLoc();
void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};
#endif // LEVEL_H