Skip to content

Instantly share code, notes, and snippets.

@gastoncaminiti
Created April 28, 2025 19:00
Show Gist options
  • Save gastoncaminiti/43652e05544224bd602f73f1c2524731 to your computer and use it in GitHub Desktop.
Save gastoncaminiti/43652e05544224bd602f73f1c2524731 to your computer and use it in GitHub Desktop.
Fundamentos de C# y Raylib - Programacion 1 Clase 03 [Mover Circulo]
// Importar Raylib
using Raylib_cs;
using System.Numerics;
// Declarar e Inicializar Vector2
Vector2 position = new Vector2(100,100);
// Inicializar ventana y contexto OpenGL
Raylib.InitWindow(800, 600, "Mi Videojuego");
// Verificar si la aplicación debe cerrarse (se presionó la tecla ESC o se hizo clic en el ícono de cerrar ventana)
while (!Raylib.WindowShouldClose())
{
// ============ MAIN LOOP ===========//
// Establecer el color de fondo
Raylib.ClearBackground(Color.Beige);
// Configurar el canvas (framebuffer) para comenzar a dibujar
Raylib.BeginDrawing();
// Modificar posicionX e posicionY
position.X = position.X + 0.5f;
position.Y = position.Y + 0.5f;
// Dibujar un círculo relleno de color (versión vectorial)
Raylib.DrawCircleV(position, 50, Color.DarkBrown);
// Finalizar el dibujo en el Canvas y cambia los búferes (doble búfer)
Raylib.EndDrawing();
}
// Cerrar ventana y descargar contexto de OpenGL)
Raylib.CloseWindow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment