diff options
Diffstat (limited to 'solid.c')
-rw-r--r-- | solid.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#include "solid.h" + +Entity new_solid(World* world, int x, int y, int w, int h) { + Entity e; + CCollider* col; + CPosition* pos; + + e = new_entity(world); + add_components( + world, + e, + ctype_position | + ctype_collider | + ctype_solid + ); + pos = &world->positions[e]; + col = &world->colliders[e]; + + pos->x = x; + pos->y = y; + col->x = 0; + col->y = 0; + col->w = w; + col->h = h; + + return e; +} |