-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathckobj.h
52 lines (47 loc) · 1.43 KB
/
ckobj.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
48
49
50
51
52
#include <ClanLib/display.h>
//#include <ClanLib/png.h>
#include "cktrack.h"
#include "ckmenu.h"
#define ADJ 40
#define CAR_W 80
#define CAR_L 80
#define BLK 64
enum coll_area {NONE=0, CENTRE, NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH,
SOUTH_WEST, WEST, NORTH_WEST};
class ckobj
{
protected:
CL_Surface *image;
float x;
float y;
float vel;
int max_vel;
double ang;
int bridge;
int guide;
char find_guide(cktrack *track);
void autoguide(cktrack *track, double ang_inc);
public:
ckobj(void);
~ckobj(void);
int getx(void);
int gety(void);
void addx(float val);
void addy(float val);
void setx(float val);
void sety(float val);
CL_Surface *get_image(void);
void load_image(const char *path);
enum coll_area detect_walls(float x, float y, CL_Surface *image,
unsigned char *track_data, int b);
void display_on_screen(ckobj *p1, int swidth, int sheight);
void display_on_screenxy(CL_Surface *im, int px, int py, int swidth, int sheight);
void display_on_screen1(ckobj *p1, int swidth, int sheight);
void display_on_screen1xy(CL_Surface *im, int px, int py, int swidth, int sheight);
void display_on_screen2(ckobj *p1, int swidth, int sheight);
void display_on_screen2xy(CL_Surface *im, int px, int py, int swidth, int sheight);
int get_bridge(void);
int get_guide(void);
double get_guide_ang(char c);
};
extern void calc_vel(double ang, float vel, float *hor_vel, float *ver_vel);