-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bird.h
68 lines (46 loc) · 1.33 KB
/
Bird.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
/*
* Bird.h
*
* Created on: May, 2019
* Author: esantiago
*/
#ifndef BIRD_H_
#define BIRD_H_
#include <SDL2/SDL.h>
class GamePlay;
class Gunner;
// Abstract Bird class
class Bird
{
public:
// the dimensions of the bird
const int BIRD_WIDTH = 78;
const int BIRD_HEIGHT = 48;
// max horizontal velocity of the bird
const int BIRD_XVEL = 5;
// default constructor
Bird();
// initializes the variables
Bird( int x, int y);
// moves the bird
virtual void move( Gunner &gunner) = 0; // makes this an Abstract class
// shows the bird on the screen
virtual void render( GamePlay &GP);
virtual void sfx_call();
bool delBird_flag;
bool hitBird_flag;
virtual int getmCollx(); // left off here... made these methods virtual.. same as move() for correct implementation
virtual int getmColly();
virtual int getmCollw();
virtual int getmCollh();
protected:
// the X and Y offsets of the bird
int mPosX, mPosY;
// the x and y velocity of the bird
int mVelX, mVelY;
// bird's collision box
SDL_Rect mCollider;
// reposition coll box relative to bird's offset
virtual void shiftCollider();
};
#endif // BIRD_H_