18 static int health = -1;
21 if (player ==
nullptr)
return;
23 int playerHealth = player->getComponent<
Health>()->getHealth();
24 bool shakeCamera =
false;
25 if (playerHealth != health) {
27 health = playerHealth;
Vec2 m_worldPosition
Stores the world position of the camera.
void setWorldPosition(float x, float y)
A component for managing health of game objects.
static SceneManager & getInstance()
Retrieves the singleton instance of SceneManager.
SceneTree * getSceneTree()
Retrieves the current scene tree managing the game objects.
std::vector< GameObject * > findGameObjectsByTag(std::string tag)
Finds GameObjects by a tag.
Defines the Health class, a component for managing the health of game objects.
Defines the SceneManager class for managing scenes in the game.
A structure to represent 2D vectors.
float y
Y coordinate of the vector.
float x
X coordinate of the vector.