Skip to main content

Character

The main structure representing a player or opponent in the game, including health, mana, position, and death state management.

Fields

float
default:"300.0f"
Current health points of the character. When health reaches 0, the character dies. Can exceed maximum when shields are active.
float
default:"300.0f"
Current mana points used for casting spells and abilities. Drains when camera zoom is below 5.0f, regenerates above 5.0f.
double
default:"0.0"
Timer used to track shield decay intervals. When health exceeds 300.0f, this timer counts up to 2.0 seconds before reducing health by 3.0f.
bool
default:"false"
Indicates whether the character is currently draining mana due to camera zoom being below the threshold (5.0f).
bool
default:"false"
Tracks whether the character has cast a spell and projectiles are currently active in the world.
float
default:"0.0f"
Timer for death animation fade effect. Ranges from 0.0f to 1.0f, incremented by GetFrameTime() * 0.5f when character dies.
bool
default:"false"
Indicates whether the character is currently dead. Set to true when health drops to or below 0.0f.
bool
default:"false"
Ensures the death sound effect plays only once per death. Reset to false when character respawns.
bool
default:"false"
Distinguishes between the local player (true) and opponents (false). Used for rendering, input handling, and network synchronization.
Vector2
default:"{}"
World position coordinates of the character. Initialized randomly within safe spawn areas and updated based on movement input.
Rectangle
default:"{ 0, 0, 20, 40 }"
Collision rectangle for the character with width 20 and height 40. Used for collision detection with trees and boundaries.

Ball

Represents a spell projectile cast by a character, including its appearance, trajectory, and damage properties.

Fields

Color
default:"RED"
Visual color of the spell projectile. Red spells (bloodRed = ) use radius 35.0f, blue spells (DARKBLUE) use default 25.0f radius.
Vector2
default:"{}"
Current world position of the projectile. Updated each frame based on direction and ball_speed.
Vector2
default:"{}"
Target destination in world coordinates where the player aimed when casting. Projectile moves toward this position.
float
default:"25.0f"
Current radius of the projectile in pixels. Decreases by 0.1f per frame and by 5.0f when colliding with trees.
float
Movement speed multiplier for the projectile. Red spell (KEY_ONE) uses 2.0f, blue spell (KEY_TWO) uses 4.0f.
float
default:"0.0f"
Damage dealt by the projectile on impact. Calculated as 1.0f * ball_r at creation time.

PositionPacket

Network packet structure for synchronizing character positions between client and server in multiplayer mode.

Fields

float
X-coordinate of the character’s position in world space. Sent over the network when position changes.
float
Y-coordinate of the character’s position in world space. Sent over the network when position changes.