supercasiobros/include/plateforme.h

51 lines
848 B
C

#ifndef PLATEFORME_H
#define PLATEFORME_H
#define P_FALLING 0
#define P_MOVING_H 1
#define P_MOVING_V 2
#include <box.h>
typedef struct
{
unsigned type;
int xinit, yinit;
union
{
int xmin;
int ymin;
};
union
{
int xmax;
int ymax;
};
int counter;
box_t b;
} plateform_t;
#define PLATEFORME_HEIGHT 3
// Init macros
#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}}
void platformsMove();
void platformsDraw();
int platformsCollisionTest(int x, int y);
void platformsInit(plateform_t * table, int s);
/*
extern int plateform_table_size;
extern plateform_t* plateformes;
*/
#endif