#include "particles.h"
#include "factory_objects.h"
#include "utils.h"

void Particles_SpawnGroundParticles(float x, float y)
{
    unsigned int i  = 0;
    object_t *object = NULL;

    int count = Utils_GetRandomRange(10, 20);

    for (i = 0; i < count; ++i)
    {
        int max_life = Utils_GetRandomRange(10, 30);
        float rx = Utils_GetRandomRange(x - 20, x + 20);
        float ry = Utils_GetRandomRange(y - 5, y);

        object = FactoryObjects_Create();
        Actor_GroundParticle_Create(object, rx, ry, max_life);
    }
}

void Particles_SpawnGibletParticles(float x, float y)
{
    unsigned int i  = 0;
    object_t *object = NULL;

    int count = Utils_GetRandomRange(10, 20);

    for (i = 0; i < count; ++i)
    {
        int max_life = Utils_GetRandomRange(10, 30);
        float rx = Utils_GetRandomRange(x - 20, x + 20);
        float ry = Utils_GetRandomRange(y - 5, y);

        object = FactoryObjects_Create();
        Actor_GibletParticle_Create(object, rx, ry, max_life);
    }
}

