2020-01-11 15:19:53 +01:00
|
|
|
#ifndef PLATEFORME_H
|
|
|
|
#define PLATEFORME_H
|
|
|
|
|
|
|
|
#define P_FALLING 0
|
|
|
|
#define P_MOVING_H 1
|
|
|
|
#define P_MOVING_V 2
|
|
|
|
|
2020-02-04 20:12:17 +01:00
|
|
|
#include <box.h>
|
2020-01-11 15:19:53 +01:00
|
|
|
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
typedef struct
|
2020-01-11 15:19:53 +01:00
|
|
|
{
|
|
|
|
unsigned type;
|
|
|
|
int xinit, yinit;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
int xmin;
|
|
|
|
int ymin;
|
|
|
|
};
|
|
|
|
union
|
|
|
|
{
|
|
|
|
int xmax;
|
|
|
|
int ymax;
|
|
|
|
};
|
|
|
|
int counter;
|
2020-02-04 20:12:17 +01:00
|
|
|
box_t b;
|
2020-02-16 20:43:35 +01:00
|
|
|
} plateform_t;
|
2020-01-11 15:19:53 +01:00
|
|
|
|
|
|
|
#define PLATEFORME_HEIGHT 3
|
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
// Init macros
|
2020-02-04 20:12:17 +01:00
|
|
|
#define PLATEFORME_FALLING(x,y,w) {P_FALLING,x,y,.xmin=0,.xmax=0,0, {x,y,w,3, 0,0, 0,0}}
|
|
|
|
#define PLATEFORME_MOVING_H(x,y,w,v,x0,x1) {P_MOVING_H,x,y,.xmin=x0,.xmax=x1,0, {x,y,w,3, v,0, 0,0}}
|
|
|
|
#define PLATEFORME_MOVING_V(x,y,w,v,y0,y1) {P_MOVING_V,x,y,.ymin=y0,.ymax=y1,0, {x,y,w,3, 0,v, 0,0}}
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void platformsMove();
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void platformsDraw();
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
int platformsCollisionTest(int x, int y);
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
void platformsInit(plateform_t * table, int s);
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
/*
|
|
|
|
extern int plateform_table_size;
|
|
|
|
extern plateform_t* plateformes;
|
|
|
|
*/
|
2020-01-11 15:19:53 +01:00
|
|
|
|
2020-02-16 20:43:35 +01:00
|
|
|
#endif
|