-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathball.h
24 lines (22 loc) · 811 Bytes
/
ball.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
#include "hole.h" //aggregation, all headers are defined in it
class ball {
int initx, inity, currx, curry, xspeed, yspeed, height, width;
BITMAP *image;
BITMAP *balllost;
BITMAP *buffer;
BITMAP *score[6];
BITMAP *gameover;
BITMAP *win;
SAMPLE *swing;
int ball_left;
int level;
hole HOLE; //aggregation of hole class
public:
ball(); //constructor to initialize attributes
bool load_bitmap_and_sample();//used for exception handling
void draw(int, int, int, int*, int*, bool);
int update_position(int); //move to next position
int ball_lost();
void speed(int); //calculate speed on the basis of direction
~ball(); //unload bitmap from memory
};