#include "play.h"

/* Initializes play state. */
void
play_init(Play* self, State* state)
{
	memset(self, '\0', sizeof(Play));

	self->state = state;

	self->player = ecs_entity_add(&self->state->game->ecs);
	
	entity_player_init
	(
		&self->state->game->ecs, 
		self->player, 
		(f32*)PLAY_PLAYER_POSITION
	);

	for (s32 i = 0; i < 100; i++)
	{
		u32 test;
		vec3 vec;
		vec3 pos = {990.0f, 480.0f, 0.0f};
		f32 height;

		test = ecs_entity_add(&self->state->game->ecs);
		
		vec[0] = RANDOM_F32(-50.0f, 50.0f);
		vec[1] = RANDOM_F32(-50.0f, 50.0f);
		vec[2] = 0.0f;

		height = RANDOM_F32(0.0f, 1000.0f);

		entity_goodie_init
		(
			&self->state->game->ecs,
			test,
			pos,
			vec,
			height
		);


	}
}
