-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathLevel.h
62 lines (49 loc) · 1.02 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
52
53
54
55
56
57
58
59
60
61
62
//
// Level.h
// FlappingBird
//
// Created by C0deH4cker on 1/30/14.
// Copyright (c) 2014 C0deH4cker. All rights reserved.
//
#ifndef _FB_LEVEL_H_
#define _FB_LEVEL_H_
#include <list>
#include <random>
#include <sge.h>
#include "Pipe.h"
#include "Score.h"
using namespace sge;
class Level {
public:
const static int scrollSpeed;
const static float pipeDistance;
const static float pipeSpread;
Level(const Content& content, Rectangle bounds);
~Level();
void update(double deltaTime);
void draw(double deltaTime);
void charTyped(unsigned char uc);
void pause();
void resume();
bool isPaused() const;
void restart();
private:
Bird* bird;
bool paused;
bool started;
Rectangle viewport;
Texture2D* sprites;
Score score;
Sprite background;
Sprite pipeTop;
Sprite pipeBottom;
Sprite ground;
Rectangle groundRect;
float distance;
std::list<Pipe*> pipes;
std::mt19937 rng;
std::uniform_real_distribution<float> distribution;
void addPipe(float scrolled);
void showScore();
};
#endif /* _FB_LEVEL_H_ */