0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 10:13:42 +00:00
SDL_Minigame/include/HealthComponent.h
Markus 0a1747d651 replayability added,
popup window for victory added,
png files for new skins and popups added
2024-01-29 15:04:44 -06:00

31 lines
595 B
C++

#pragma once
#include "Component.h"
class Manager;
class HealthComponent : public Component
{
public:
HealthComponent(int health, Manager* manager, bool player) : health(health), manager(manager), player(player) {}
~HealthComponent() {}
void getDamage() { this->health--; }
int getHealth() { return this->health; }
void init() override;
void createAllHearts();
void createHeartComponents(int x);
void setHealth(int health) {this->health = health;}
private:
int health;
Manager* manager;
bool player; //true if player1 / false if player2
};