Skip to content

Visual Effects for Animal Interactions

pchsa edited this page Oct 16, 2023 · 12 revisions

Visual Effects for Animal Interactions

Overview

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.

Damage Effect

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:

Damage Effect Demo

Status Indicators

Exclamation

When chasing chickens or interacting with friendly animals, an exclamation mark appears above the animal. This indicator helps players identify interactions with these animals.

Red Exclamation

To distinguish between friendly and hostile animals, a red exclamation mark appears when enemy animals attack or behave aggressively.

Fed

When players feed animals, a "fed" indicator, typically a happy face, appears above the animal, indicating that it has been fed.

Heart

Tamed animals exhibit a "heart" indicator, showing that they have been successfully tamed and are friendly.

Question

When animals are interested in food, a "question mark" appears above them, indicating their curiosity or hunger.

System Overview

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 Visual Effects UML Diagram

Components and Controllers

  • 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.

Clone this wiki locally