Skip to content
JUJHKJHLjk edited this page May 10, 2025 · 1 revision

#include "raylib.h"

int main() { InitWindow(800, 600, "DustRunner - Ball Adventure");

Camera3D camera = { 0 };
camera.position = { 4.0f, 2.0f, 4.0f };
camera.target = { 0.0f, 0.0f, 0.0f };
camera.up = { 0.0f, 1.0f, 0.0f };
camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE;

SetCameraMode(camera, CAMERA_FREE);

SetTargetFPS(60);

while (!WindowShouldClose()) {
    UpdateCamera(&camera);

    BeginDrawing();
    ClearBackground(RAYWHITE);

    BeginMode3D(camera);
        DrawSphere((Vector3){ 0.0f, 1.0f, 0.0f }, 1.0f, BLUE); // The ball
        DrawPlane((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector2){ 50.0f, 50.0f }, BEIGE); // Ground
        DrawGrid(20, 1.0f);
    EndMode3D();

    DrawText("Travel as far as you can!", 10, 10, 20, DARKGRAY);
    EndDrawing();
}

CloseWindow();
return 0;

}

Clone this wiki locally