-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpinball.h
More file actions
42 lines (34 loc) · 738 Bytes
/
pinball.h
File metadata and controls
42 lines (34 loc) · 738 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
#ifndef __PINBALL_H__
#define __PINBALL_H__
#include"ctrl/ctrl.h"
#include<time.h>
class Scene: public BackGround {
public:
Scene(int h, int w, bool fillSpace=false, Ctrl *parent=NULL);
void erasePix(int x, int y);
};
class Pad: public Ctrl {
public:
int length;
Pad(int length, Ctrl *parent=NULL);
void toShow(int focus);
int Left();
int Right();
int lastX, lastTime, direct;
int TimeEvent(int timestamp);
};
class PinBall: public Ctrl {
protected:
Pad *pad;
int xSpeed, ySpeed;
public:
PinBall(Pad *pad, Ctrl *parent=NULL): Ctrl(parent) {
this->pad=pad;
xSpeed=ySpeed=0;
}
void toShow(int focus);
int TimeEvent(int timestamp);
int CollisionDetect();
int EraseDetect();
};
#endif