-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPad.h
39 lines (35 loc) · 894 Bytes
/
Pad.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
// Copyright Milan Oberkirch
// <[email protected]>
#ifndef PROJEKT_PAD_H_
#define PROJEKT_PAD_H_
#include <stdio.h>
#include <stdlib.h>
#include "./Pong.h"
// Sub-class of Pong for managing counters and creating window.
class Pad
{
friend class Pong;
public:
// Constructor creats window, sets counters
Pad();
// Destructor resets window state
~Pad();
// (re)initialice the window, (re)set counter
void Init();
// (re)draw the counter
void Draw();
// refresh everything
void Clear();
// increase one counter
void CountUp(bool left);
private:
// width and hight of the window
int _xMax, _yMax;
// dimensions of the playground (Max is inclusive)
int _xMaxPlay, _yMaxPlay, _xMinPlay, _yMinPlay;
// center Position relative to the playground
int _xMid, _yMid;
// current score
int _counterLeft, _counterRight;
};
#endif // PROJEKT_PAD_H_