#include "cGame.h"
#include "cHeart.h"
#include "MediaVars.h"

cHeart::cHeart(cGame *g, double xx, double yy)
{
	game = g;
	x = xx;
	y = yy;
	depth = 0;
	collide.SetPosition(xx,yy);
	collide.SetLeft(12);
	collide.SetTop(44);
	collide.SetRight(52);
	collide.SetBottom(64);
	objectType = HEART;
	depth = (collide.GetY()+34);
	destroyed = false;
}

void cHeart::Update()
{
}

void cHeart::Draw()
{
	sprHeart->SetPosition((float)(int)x+8,(float)(int)y+8);
	game->GetWindow()->Draw(*sprHeart);
	sprShadow->SetPosition((float)(int)x,(float)(int)y);
	game->GetWindow()->Draw(*sprShadow);
}

void cHeart::Destroy(bool fromPlayer)
{
	if (fromPlayer)
		game->AddItemToObtainedVector(x,y);
	destroyed = true;
}