<commit_before>#include <Health.hpp>

using namespace uth;

Health::Health()
{
	auto healthTex = uthRS.LoadTexture("UI/life.png");
	healthTex->SetSmooth(true);
	AddComponent(new Sprite(healthTex));
	transform.SetOrigin(uth::Origin::TopLeft);

		
	m_Mhealth = 1;
	m_Chealth = m_Mhealth;



}

void Health::TakeDamage(float amount)
{
	m_Chealth -= amount/100;
}

void Health::Update(float dt)
{
	GameObject::Update(dt);
	transform.SetPosition(uthEngine.GetWindow().GetCamera().GetPosition().x - uthEngine.GetWindow().GetSize().x/2,
		uthEngine.GetWindow().GetCamera().GetPosition().y - uthEngine.GetWindow().GetSize().y / 2);
	if (m_Chealth == m_Mhealth)
	{
		GetComponent<Sprite>("Sprite")->SetColor(0, 1, 0, 1);
	}
	
	if (m_Chealth <= m_Mhealth)
	{
		n = m_Mhealth - m_Chealth;
		GetComponent<Sprite>("Sprite")->SetColor(0+n, 1-n, 0, 1);

	}
	if(m_Chealth == 0)
	{
		m_Chealth = 0;
		GetComponent<Sprite>("Sprite")->SetColor(0, 0, 1, 1);
	}
}

void Health::Draw()
{
	GameObject::Draw(uthEngine.GetWindow());
}
Health::~Health()
{
}<commit_msg>health more pro<commit_after>#include <Health.hpp>

using namespace uth;

Health::Health()
{
	auto healthTex = uthRS.LoadTexture("UI/life.png");
	healthTex->SetSmooth(true);
	AddComponent(new Sprite(healthTex));
	transform.SetOrigin(uth::Origin::TopLeft);

		
	m_Mhealth = 1;
	m_Chealth = m_Mhealth;



}

void Health::TakeDamage(float amount)
{
	m_Chealth -= amount/100;
}

void Health::Update(float dt)
{
	GameObject::Update(dt);
	transform.SetPosition(uthEngine.GetWindow().GetCamera().GetPosition().x - uthEngine.GetWindow().GetSize().x/2,
		uthEngine.GetWindow().GetCamera().GetPosition().y - uthEngine.GetWindow().GetSize().y / 2);
	if (m_Chealth == m_Mhealth)
	{
		GetComponent<Sprite>("Sprite")->SetColor(0, 1, 0, 1);
	}
	
	if (m_Chealth <= m_Mhealth)
	{
		n = m_Mhealth - m_Chealth;
		GetComponent<Sprite>("Sprite")->SetColor(0+n, 1-n, 0, 1);
		transform.SetScale(m_Chealth, 1);

	}
	if(m_Chealth == 0)
	{
		GetComponent<Sprite>("Sprite")->SetColor(0, 0, 1, 1);
	}
}

void Health::Draw()
{
	GameObject::Draw(uthEngine.GetWindow());
}
Health::~Health()
{
}
{'fraction_non_alphanumeric': 0.18841955386805886, 'fraction_numerical': 0.018984337921214997, 'mean_word_length': 5.255192878338279, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6244769', 'n_tokens_mistral': 880, 'n_tokens_neox': 838, 'n_words': 122}