-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathball.h
47 lines (31 loc) · 754 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Created by Guy Wilks on 2/4/22.
//
#ifndef PONG_BALL_H
#define PONG_BALL_H
#include "coordinate.h"
#include <Q9_6.h>
#include <vram.h>
#include "patterns.h"
#include "backend/headers/Q9_6.h"
#include "backend/headers/screen.h"
#define BallHeight 5
#define BallWidth 5
typedef enum direction_e {LEFT, RIGHT} direction_t;
typedef struct Ball{
Q9_6 vx;
Q9_6 vy;
Q9_6 x_pos;
Q9_6 y_pos;
} ball_t;
extern ball_t BALL;
void ball_init(void);
Q9_6 compute_path(ball_t* ball);
Q9_6 compute_xpos(Q9_6 x_n, Q9_6 vx, Q9_6 f);
Q9_6 compute_ypos(Q9_6 y_n, Q9_6 vy, Q9_6 f);
void setBall(ball_t* ball);
void ball_advance(void);
direction_t getDirection(void);
void ball_draw_init_f(void);
void ball_draw(void);
#endif //PONG_BALL_H