29 lines
387 B
C
Executable File
29 lines
387 B
C
Executable File
#ifndef BOX_H
|
|
#define BOX_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
// Box type
|
|
// Used to simulate gravity and collides
|
|
|
|
typedef struct
|
|
{
|
|
int x :16;
|
|
int y :16;
|
|
|
|
unsigned w :8;
|
|
unsigned h :8;
|
|
|
|
int vx :8;
|
|
int vy :8;
|
|
int last_vy :8;
|
|
int gravity :8;
|
|
//int isMario;
|
|
} box_t;
|
|
|
|
void boxMove(box_t * b);
|
|
bool boxContact(box_t const * b1, box_t const * b2);
|
|
void boxJump(box_t * b, int height);
|
|
|
|
#endif
|