Skip to main content

Movement controls

Use WASD keys to move your wizard around the battlefield:
W
key
Move up (decreases Y position by 0.5f per frame)
A
key
Move left (decreases X position by 0.5f per frame)
S
key
Move down (increases Y position by 0.5f per frame)
D
key
Move right (increases X position by 0.5f per frame)
if (IsKeyDown(KEY_D)) all_players[0].pos.x += 0.5f;
else if (IsKeyDown(KEY_A)) all_players[0].pos.x -= 0.5f;
else if (IsKeyDown(KEY_S)) all_players[0].pos.y += 0.5f;
else if (IsKeyDown(KEY_W)) all_players[0].pos.y -= 0.5f;
Movement is blocked when colliding with trees. The game automatically reverts your position if you try to move into a tree.

Spell casting

Cast spells by holding a spell key and clicking the left mouse button:
Hold KEY_ONE (1) and click Left Mouse Button to cast the red spell
if (IsKeyDown(KEY_ONE)){
    if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)){
        if (all_players[0].mana >= 25.0f){
            Ball red_ball;
            red_ball.spellColor = bloodRed;
            red_ball.ball_speed = 2.0f;
            red_ball.ball_r = 35.0f;
        }
    }
}

Healing

Right Mouse Button
mouse
Hold to drain mana and restore health. Drains 10.0f mana and adds 2.0f health per frame.
if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON) && all_players[0].mana>12.0f){
    all_players[0].mana = all_players[0].mana - 10.0f;
    all_players[0].health = all_players[0].health+2.0f;
}
You need at least 12.0f mana to use healing. The ability drains mana rapidly at 10.0f per frame.

Camera controls

Adjust your view of the battlefield with zoom controls:
Z
key
Zoom in (increases camera zoom by 0.02f per frame)
X
key
Zoom out (decreases camera zoom by 0.02f per frame)
R
key
Reset zoom to 9.9f
if (IsKeyDown(KEY_Z)){
    camera.zoom += 0.02f;
}
else if (IsKeyDown(KEY_X)){
    camera.zoom -= 0.02f;
}

if (camera.zoom > 10.0f) camera.zoom = 10.0f;
else if (camera.zoom < 1.5f) camera.zoom = 1.5f;

if (IsKeyPressed(KEY_R))
{
    camera.zoom = 9.9f;
}
Zooming out below 5.0f drains your mana! The mana drain rate is calculated as camera.zoom * 0.03f per frame.

Debug controls

I
key
Debug key - reduces health by 50.0f per frame (for testing purposes)

Build docs developers (and LLMs) love