forked from eBrnd/caveblobb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayMode.hpp
70 lines (62 loc) · 1.73 KB
/
playMode.hpp
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
#ifndef PLAYMODE
#define PLAYMODE
#include <string>
#include <sstream>
#include <SDL.h>
#include <SDL_gfxPrimitives.h>
#include "globalStore.hpp"
#include "permanentStorage.hpp"
#include "gameMode.hpp"
#include "mode.hpp"
#include "particleSystem.hpp"
#include "randomNumberGenerator.hpp"
#include "floatingText.hpp"
#include "backgroundGenerator.hpp"
class PlayMode : public GameMode
{
private:
int walls_top[160], walls_bottom[160], obstacles[160], shot[131], items[160];
float player_pos, player_vel;
bool up;
int frames_to_corner, corner_at, level_height, frames_to_obstacle, passed, frames_to_item, collected;
int obstacle_distance, decrease_height_frames;
unsigned long int playtime;
unsigned long int score;
float slope;
RandomNumberGenerator* rng;
int special;
bool crashed;
bool paused;
int justHit;
int comboTime;
int hitDuringCombo;
int gameOverExplosionTime;
int superShotActive;
ParticleSystem* particles;
FloatingText* floating;
BackgroundGenerator* background;
PermanentStorage* storage;
inline void FillRect(int x, int y, int w, int h, Uint32 color);
void drawBackground();
void moveField();
void updatePlayerTail();
void drawStuff();
void drawPlayer();
void generateWalls();
void generateObstacles();
void generateItems();
bool handleInput();
void updatePlayer();
void collisionDetect();
void obstacleCounter();
void drawScorePanel();
void addExplosion(int x, int y);
void crashExplosion();
void drawPauseScreen();
Uint32 hue2rgb(float h);
public:
PlayMode(SDL_Surface* display, GlobalStore* globalStore, PermanentStorage* storage);
void reset();
Mode frame();
};
#endif