Files
WrldBox/src/render.c

39 lines
742 B
C

#include "render.h"
#include "world.h"
#include "raylib.h"
void DrawEntities(void)
{
for (int i = 0; i < MAX_ENTITIES; i++)
{
Entity *e = &entities[i];
if (!e->active)
continue;
Rectangle rect =
{
e->position.x - e->size * 0.5f,
e->position.y - e->size * 0.5f,
e->size,
e->size
};
DrawRectangleRec(rect, e->color);
DrawRectangleLinesEx(rect, 2, BLACK);
Vector2 velEnd =
{
e->position.x + e->velocity.x * 0.10f,
e->position.y + e->velocity.y * 0.10f
};
DrawLineEx(
e->position,
velEnd,
2,
DARKBLUE);
}
}