Character
The main structure representing a player or opponent in the game, including health, mana, position, and death state management.Fields
Current health points of the character. When health reaches 0, the character dies. Can exceed maximum when shields are active.
Current mana points used for casting spells and abilities. Drains when camera zoom is below 5.0f, regenerates above 5.0f.
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.
Indicates whether the character is currently draining mana due to camera zoom being below the threshold (5.0f).
Tracks whether the character has cast a spell and projectiles are currently active in the world.
Timer for death animation fade effect. Ranges from 0.0f to 1.0f, incremented by GetFrameTime() * 0.5f when character dies.
Indicates whether the character is currently dead. Set to true when health drops to or below 0.0f.
Ensures the death sound effect plays only once per death. Reset to false when character respawns.
Distinguishes between the local player (true) and opponents (false). Used for rendering, input handling, and network synchronization.
World position coordinates of the character. Initialized randomly within safe spawn areas and updated based on movement input.
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
Visual color of the spell projectile. Red spells (bloodRed = ) use radius 35.0f, blue spells (DARKBLUE) use default 25.0f radius.
Current world position of the projectile. Updated each frame based on direction and ball_speed.
Target destination in world coordinates where the player aimed when casting. Projectile moves toward this position.
Current radius of the projectile in pixels. Decreases by 0.1f per frame and by 5.0f when colliding with trees.
Movement speed multiplier for the projectile. Red spell (KEY_ONE) uses 2.0f, blue spell (KEY_TWO) uses 4.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
X-coordinate of the character’s position in world space. Sent over the network when position changes.
Y-coordinate of the character’s position in world space. Sent over the network when position changes.