#include "CS_PeFlash.h"

CS_PeFlash::CS_PeFlash()
{
	type = 3;
	ani.png = L"CS_CaveStoryMod";
	ani.sprite_index = L"pe_flash";
}

void CS_PeFlash::Step()
{
	auto& ani_no = ani.image_index;
	if (++ani_wait > 2)
	{
		ani_wait = 0;
		if (++ani_no > 1)
			Destroy();
	}
}

void SetCS_PeFlash(std::shared_ptr<Entity> parent, float x, float y)
{
	auto e = std::make_shared<CS_PeFlash>();
	e->x = x;
	e->y = y;
	parent->gameFunc->SetEntity(parent, e);
}
