summaryrefslogtreecommitdiffstats
path: root/src/paddle.h
blob: 8d0e69ddd51010a8c65541b3827755582ebeb657 (plain)
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
#ifndef PADDLE_H
#define PADDLE_H

static const int PADDLE_H_POS_START = 40;
static const int PADDLE_V_POS_START = 12;
static const int PADDLE_H_SIZE_NORMAL = 8;
static const int PADDLE_V_SIZE_NORMAL = 4;
static const int PADDLE_H_SPEED_NORMAL = 2;
static const int PADDLE_V_SPEED_NORMAL = 1;
enum paddle_type {
	PADDLE_TYPE_H,
	PADDLE_TYPE_V
};

struct paddle {
	int x;
	int y;
	int width;
	int height;
	int *pos;
	int *size;
	int speed;
	int dir;
	int min_pos;
	int max_pos;
};

void clear_paddle(struct paddle *pad);
void update_paddle(struct paddle *pad);
void draw_paddle(struct paddle *pad);

#endif