supercasiobros/include/plateforme.h

53 lines
953 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;
} plateforme_t;
#define PLATEFORME_HEIGHT 3
#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 reset_plateforme(plateforme_t* p);
//void move_plateforme(plateforme_t* p); // touch mario stuff
void move_plateformes();
void display_plateformes();
int plateforme_check_collide(int x, int y);
void init_plateformes(plateforme_t * table, int s);
extern int plateforme_table_size;
extern plateforme_t* plateformes;
#endif