shared struct and enum definitions file (maybe not the best idea)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include "cat_api.h"
|
||||
#include "shared.h"
|
||||
#include "rendering.c"
|
||||
#include <time.h>
|
||||
|
||||
/* TODO:
|
||||
@@ -62,24 +64,6 @@ int is_held(char k)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct entity
|
||||
{
|
||||
int is_player;
|
||||
int is_static;
|
||||
int in_freefall;
|
||||
float x;
|
||||
float y;
|
||||
int width; /**/
|
||||
int height; /**/
|
||||
unsigned char r; /* replace this with sprite TODO */
|
||||
unsigned char g; /**/
|
||||
unsigned char b; /**/
|
||||
float vx;
|
||||
float vy;
|
||||
float ax;
|
||||
float ay;
|
||||
struct entity* next;
|
||||
};
|
||||
|
||||
struct entity* first_entity = NULL;
|
||||
|
||||
@@ -189,6 +173,7 @@ void draw_entity(struct entity* e)
|
||||
/* FIXME */
|
||||
if (e->x < 0 || e->y < 0 || e->x >= screen_width || e->y >= screen_height) return;
|
||||
cat_wireframe(1, 1, e->x, e->y, e->width, e->height, e->r, e->g, e->b);
|
||||
render_entity(e);
|
||||
/* if out of bounds do not draw */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user