-
Notifications
You must be signed in to change notification settings - Fork 7
Visual Effects for Animal Interactions
This documentation outlines the visual effects added to animal interactions in our game. These enhancements are designed to improve the player's experience by making these interactions more engaging and visually appealing. While they do not impact gameplay mechanics, they contribute to the overall aesthetics of the game.
When entities sustain damage, they exhibit a visual effect where they phase in and out of transparency, creating a "blinking" effect. This effect is demonstrated below:
When chasing chickens or interacting with friendly animals, an exclamation mark appears above the animal. This indicator helps players identify interactions with these animals.
To distinguish between friendly and hostile animals, a red exclamation mark appears when enemy animals attack or behave aggressively.
When players feed animals, a "fed" indicator, typically a happy face, appears above the animal, indicating that it has been fed.
Tamed animals exhibit a "heart" indicator, showing that they have been successfully tamed and are friendly.
When animals are interested in food, a "question mark" appears above them, indicating their curiosity or hunger.
The visual effects for animal interactions are implemented through a series of components and controllers. The UML diagram below provides an overview of the system architecture:
-
Animal Entity: This is the entity representing the animal in the game.
-
AnimationEffectsComponent: This component inherits from
AnimationRenderComponent
and offers additional functionality for drawing the sprite with specific offsets and scales. -
AnimationRenderComponent: This component handles the rendering of the sprite, and its appearance is influenced by the alpha value controlled by the
BlinkComponent
. -
AnimalEffectsController: This controller is responsible for initiating and managing animation effects for the animal entity.
-
BlinkComponent: The
BlinkComponent
is in charge of changing and monitoring the color (alpha value) of the sprite, resulting in the blinking effect.