#include "render.h"
#include "world.h"

#include "raylib.h"
// Take entities, put em on the screen. Basic rendering file. Our entities are just rectangles, which we should lowkey fix... but uh... that's a problem for LATER...
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);
    }
}
