-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiceCreamDrop.h
More file actions
47 lines (43 loc) · 1.23 KB
/
iceCreamDrop.h
File metadata and controls
47 lines (43 loc) · 1.23 KB
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
#ifndef ICECREAMDROP_H
#define ICECREAMDROP_H
#include "game.h"
#include "action.h"
#include <vector>
#include <iostream>
using namespace std;
class GameObject;
class Border;
class IceCreamDisplay;
class IceCreamDrop : public Game {
shared_ptr<GameObject> iceCream;
shared_ptr<Border> border;
shared_ptr<IceCreamDisplay> iceCreamDisplay;
const int firstPlatformHeight = 10;
const int offset = 2;
const int lowerBoundHole;
const int upperBoundHole;
const int flyFrequency = 5; //Number of platforms passed per fly generated
const int appleFrequency = 5; //Number of platforms passed per apple generated
bool makeNew = false;
int status = 1; //1 is still playing, 0 means lost.
int updateInterval = 75000;
int numOfPlatformsPassed = 0;
public:
IceCreamDrop();
~IceCreamDrop();
void position() override;
void go() override;
private:
void positionPlatforms();
void positionIceCream();
void updateView();
int getLastPlatformHeight();
void makeNewPlatform(int height);
int getRandomNumber(int lower, int higher);
void makeFly(int x, int y);
bool atLastPlatform();
bool hitFly();
void moveIceCream(Action action);
void displayHelper();
};
#endif