-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
58 lines (47 loc) · 1.19 KB
/
Game.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
#pragma once
#include <SFML\Graphics.hpp>
#include "Includes.h"
#include "Player.h"
#include "AnimatedSprite.h"
#include "Textures.h"
#include "Enemy.h"
#include "Grave.h"
#include "Ball.h"
#include <sstream>
//Handles the gameplay state, holds its entities like enemies and player would hold score etc...
//Handles interaction between entities
//TODO: Gameplay states for easy seperate levels possibly, think about it more
class Game
{
private:
//store entities
Player mPlayer;
Ball mBall;
std::vector<Enemy*> mEnemies;
std::vector<Grave*> mGraves;
Textures *mTextures;
//drawing stuff
sf::Sprite mBackground;
sf::Font mFont;
sf::Text mTextLives;
sf::Text mTextTown;
int mNumofLives;
int mTownHealth;
int mCurrentLevel;
int mMaxLevel;
public:
Game(Textures *pSpriteSheet);
virtual ~Game(void);
void update();
void draw(sf::RenderWindow *window, float pInterpolation);
void input(sf::Event *pEvent);
void addEnemy(float pX, float pY);
void removeEnemy(int pIndex);
void addGrave(float pX, float pY, float pReleaseTimeMin, float pReleaseTimeMax);
void removeGrave(int pIndex);
void quit();
void nextlevel();
void reset();
//TODO: should probably have an init
void init();
};