Skip to main content

Spell system overview

Wizard Duel features two distinct spells, each with unique properties. Spells are cast toward your mouse cursor position in world coordinates and travel automatically toward their target.

Red spell

The red spell is a slower, larger projectile with higher radius and damage.
string
Hold KEY_ONE (1) + Left Mouse Button
float
25.0f (requires at least 25.0f mana to cast)
color
bloodRed { 128, 0, 0, 255 }
float
2.0f units per frame
float
35.0f pixels
float
Calculated as 1.0f * ball_r (35.0f damage at full radius)
The red spell’s larger radius (35.0f) makes it easier to hit targets but travels slower at 2.0f speed.

Blue spell

The blue spell is a faster projectile with standard radius, requiring more mana to cast.
string
Hold KEY_TWO (2) + Left Mouse Button
float
35.0f (requires at least 35.0f mana to cast)
color
DARKBLUE (Raylib DARKBLUE constant)
float
4.0f units per frame (2x faster than red spell)
float
25.0f pixels (default Ball radius)
float
Calculated as 1.0f * ball_r (25.0f damage at full radius)
The blue spell is twice as fast (4.0f vs 2.0f) but costs more mana and has a smaller radius.

Spell mechanics

Projectile movement

Spells travel toward their target position using normalized direction vectors:

Spell decay

All spells shrink over time at a rate of 0.1f radius per frame:
Spells automatically despawn when their radius reaches zero. Plan your shots carefully!

Tree collision

Spells can destroy trees when colliding with them:
Trees are destroyed if the spell radius is at least 4.0f. Each collision reduces spell radius by 5.0f.

Spell comparison

Strengths:
  • Lower mana cost (25.0f vs 35.0f)
  • Larger radius (35.0f vs 25.0f) = easier to hit
  • Higher damage (35.0f vs 25.0f)
Weaknesses:
  • Slower travel speed (2.0f vs 4.0f)
  • Easier for opponents to dodge