#include "CS_Bill.h"

CS_Bill::CS_Bill()
{
	//初始动画设置
	ani.png = L"CS_CaveStoryMod";
	ani.sprite_index = L"ls_bill";
	//启用碰撞
	cbRect.enableCbRect = true;
	cbRect.enableSoild = true;
	//设置碰撞框
	cbRect.left = cbRect.right = 3;
	cbRect.top = 2;
	cbRect.bottom = 1;
	vy = -0x200 / ts;
}

void CS_Bill::Init(std::weak_ptr<Entity> self)
{
	stateGravity.Init(shared_from_this());
	stateGravity.SetGravityScale(0.1f);
	Entity::Init(self);
}

void CS_Bill::Step()
{
	stateGravity.Step();
	//清除最后一次碰撞结果
	Entity::ClearCollisionResult();
	//执行运动
	Entity::Step();
	//执行碰撞
	Entity::Collision();
}

std::shared_ptr<Entity> CreateCS_Bill()
{
	return std::make_shared<CS_Bill>();
}
