using Raylib_cs;

int screenWidth = 800;
int screenHeight = 600;
int radius = 25;

Raylib.InitWindow(screenWidth, screenHeight, "Motion and Decisions");
Raylib.SetTargetFPS(60);

var ballX = screenWidth / 2;
var ballY = screenHeight / 2;
var speed = 5;

while (!Raylib.WindowShouldClose())
{
    if (Raylib.IsKeyDown(KeyboardKey.Right))
    {
        ballX += speed;
    }

    if (Raylib.IsKeyDown(KeyboardKey.Left))
    {
        ballX -= speed;
    }

    if (Raylib.IsKeyDown(KeyboardKey.Down))
    {
        ballY += speed;
    }

    if (Raylib.IsKeyDown(KeyboardKey.Up))
    {
        ballY -= speed;
    }

    ballX = Math.Clamp(ballX, radius, screenWidth - radius);
    ballY = Math.Clamp(ballY, radius, screenHeight - radius);

    Raylib.BeginDrawing();
    Raylib.ClearBackground(Color.Black);
    Raylib.DrawText("Move with the arrow keys", 20, 20, 20, Color.LightGray);
    Raylib.DrawCircle(ballX, ballY, radius, Color.SkyBlue);
    Raylib.EndDrawing();
}

Raylib.CloseWindow();
