forked from housq/RiverRaid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRRApp.h
69 lines (64 loc) · 1.54 KB
/
RRApp.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
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef RR_APP_H
#define RR_APP_H
#include "Asset.h"
#include "SDL2/SDL.h"
#include "RRMap.h"
#include "Fuel.h"
#include <vector>
#include "Bullet.h"
class Fuel;
class Asset;
class Bullet;
class Enemy;
class RRApp{
public:
RRApp(SDL_Window *window, SDL_Renderer *renderer);
void mainLoop();
int getSpeed();
void generateEnemies();
void updateEnemyPoistion();
void renderEnemy();
void clearEnemies();
void updatePlayerPosition(int flag);
void generateFule();
void updateFuelPoistion();
void renderFuel();
void clearFuel();
void renderBullet();
void fireBullet(int flag);
void checkPlayerEnemyCollison(int i);
void checkBulletEnemyCollison(int i);
void checkPlayerFuleCollison(int i);
void checkBulletMapCollision();
void checkPlayerMapCollision();
void renderFuleBar();
void updateFuleBar();
void checkFule();
void checkFuleColiison(int i);
void buildFuleVec();
int lastTime , lastTime2;
SDL_Texture *fuleLevelBar;
SDL_Rect fuleRect;
int maxFuleNumber;
int fuleI;
private:
int keyStatus[5] = {0};
void updateSpeed();
int maxBullet;
int speed , xspeed;
RRMap *map;
Asset *player1;
Uint32 start = 0;
bool running;
bool fuleEmpty;
vector<Enemy*> enemyVec;
vector<Fuel*> fuleVec;
vector<Bullet*> bulletVec;
bool finish , f , fired;
SDL_Window *window;
SDL_Renderer *renderer;
void updateGame();
void renderGame();
void eventHandler(SDL_Event &event);
};
#endif