-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.hpp
More file actions
44 lines (30 loc) · 741 Bytes
/
Game.hpp
File metadata and controls
44 lines (30 loc) · 741 Bytes
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
#pragma once
#include "InfiniteSideScrollingSprite.hpp"
#include "Plane.hpp"
#include "Spikes.hpp"
#include "Sprite.hpp"
namespace TappyPlane {
class Game {
public:
Game();
void handleEvent(const SDLW::Events::Event&) noexcept;
void update() noexcept;
void draw() const;
private:
enum class State {
GetReady, InProgress, GameOver
};
void start();
void reset();
bool hasPlaneCrashed();
bool didPlaneHitTheGround();
bool didPlaneHitTheCeiling();
State mGameState;
InfiniteSideScrollingSprite mBackground;
InfiniteSideScrollingSprite mGround;
Spikes mSpikes;
Plane mPlane;
Sprite mGetReadySprite;
Sprite mGameOverSprite;
};
} // namespace TappyPlane