This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(300, 400); | |
| frameRate(60); | |
| } | |
| int gameState = 0; | |
| int score = 0; | |
| int highScore = 0; // ← nuevo: guarda el récord | |
| float timer = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup() { | |
| size(500, 500); | |
| background(200); | |
| } | |
| void draw() { | |
| delay(100); | |
| fill(255, 8); // efecto fade | |
| noStroke(); | |
| rect(0, 0, width, height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |