Skip to main content

Character stats

Each wizard in the game has a set of core stats managed through the Character struct:
float
default:"300.0f"
Current health points. When health reaches 0.0f, the character dies.
float
default:"300.0f"
Current mana points. Required for casting spells and healing.
Rectangle
default:"{ 0, 0, 20, 40 }"
Character collision box (20 pixels wide, 40 pixels tall).

Health system

Starting health

All characters begin with 300.0f health. This is displayed as a red bar above each character.

Death mechanic

When health drops to or below 0.0f, the character enters death state:
Leaving the map boundaries instantly kills you by setting health to 0.0f:

Mana system

Starting mana

All characters begin with 300.0f mana. This is displayed as a purple bar above each character.

Mana regeneration

Mana regenerates slowly when camera zoom is above 5.0f:
Mana regenerates at 0.01f per frame when zoomed in past 5.0f and below max mana.

Mana drain from zoom

Zooming out below 5.0f drains mana at a rate proportional to zoom level:
The game displays “DRAINING MANA” when this occurs:
The drain rate increases as you zoom out further. At camera.zoom = 1.5f (minimum), you drain 0.045f mana per frame.

Healing mechanic

Hold the right mouse button to convert mana into health:
float
10.0f mana per frame
float
2.0f health per frame
float
12.0f (healing disabled below this threshold)
The healing conversion ratio is 5:1 (mana to health). At 60 FPS, you can heal 120 health per second while draining 600 mana per second.

Shields system

When health exceeds 300.0f through healing, shields activate:

Shield mechanics

Shields activate automatically when health > 300.0fThe game displays “SHIELDS UP” message on screen
Shields decay slowly but continuously. You lose 3.0f health every 2.0 seconds (1.5f per second) when above 300.0f.

Collision detection

Player-tree collision

Players cannot move through trees. The game checks collision using rectangles:
When collision is detected, movement is reverted:
Player hitbox: 20x40 pixelsTree hitbox: 20x60 pixels

Spell-tree collision

Spells can collide with and destroy trees:
float
4.0f - spells smaller than this bounce off trees without destroying them
float
5.0f - each tree collision reduces spell radius by this amount

Combat tips

  • Keep mana above 35.0f to have both spell options available
  • Don’t overheal unless you need the shield buffer
  • Avoid zooming out below 5.0f for extended periods