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.Hold KEY_ONE (1) + Left Mouse Button
25.0f (requires at least 25.0f mana to cast)
bloodRed
{ 128, 0, 0, 255 }2.0f units per frame
35.0f pixels
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.Hold KEY_TWO (2) + Left Mouse Button
35.0f (requires at least 35.0f mana to cast)
DARKBLUE (Raylib DARKBLUE constant)
4.0f units per frame (2x faster than red spell)
25.0f pixels (default Ball radius)
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: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
- Red spell
- Blue spell
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)
- Slower travel speed (2.0f vs 4.0f)
- Easier for opponents to dodge