Skip to content

Instantly share code, notes, and snippets.

View lpz777-coder's full-sized avatar

lpz777-coder

  • Joined Apr 9, 2026
View GitHub Profile
void setup() {
size(300, 400);
frameRate(60);
}
int gameState = 0;
int score = 0;
int highScore = 0; // ← nuevo: guarda el récord
float timer = 0;
void setup() {
size(500, 500);
background(200);
}
void draw() {
delay(100);
fill(255, 8); // efecto fade
noStroke();
rect(0, 0, width, height);
float x = 100.0; // posición inicial (no en diagonal)
float y = 100.0;
float stepX = 4.0; // velocidad horizontal
float stepY = 3.0; // velocidad vertical (diferente)
float radio = 35.0;
void setup() {
size(500, 500);
noStroke();
ellipseMode(RADIUS);
void setup() {
size(500, 500);
}
void draw() {
background(50, 100, 200); // fondo azul en RGB
// Distancia del ratón al centro
float distancia = dist(mouseX, mouseY, width/2, height/2);