Diferencia entre revisiones de «Archivo:Bounceball.gif»
De Casiopea
(PVector location; // Location of shape PVector velocity; // Velocity of shape PVector gravity; // Gravity acts at the shape's acceleration void setup() { size(640,360); location = new PVector(100,100); velocity = new PVector(1.8,2.8); gra…) |
|||
Línea 1: | Línea 1: | ||
Revisión actual - 02:39 21 may 2019
void setup() {
size(640,360); location = new PVector(100,100); velocity = new PVector(1.8,2.8); gravity = new PVector(0,0.8);
}
void draw() {
background(0); // vector de velocidad location.add(velocity); // vector de gravedad (fuerza) velocity.add(gravity); if ((location.x > width) || (location.x < 0)) { velocity.x = velocity.x * -1; } if (location.y > height) { // velocidad reducida al golpear la esquina inferior. velocity.y = velocity.y * -0.95; location.y = height; }
// variantes de la pelota stroke(255); strokeWeight(8); fill(17); ellipse(location.x,location.y,48,48);
}
Historial del archivo
Haz clic sobre una fecha y hora para ver el archivo tal como apareció en ese momento.
Fecha y hora | Miniatura | Dimensiones | Usuario | Comentario | |
---|---|---|---|---|---|
actual | 02:38 21 may 2019 | 641 × 371 (3 kB) | Gonzalogallo (discusión | contribs.) | PVector location; // Location of shape PVector velocity; // Velocity of shape PVector gravity; // Gravity acts at the shape's acceleration void setup() { size(640,360); location = new PVector(100,100); velocity = new PVector(1.8,2.8); gra… |
No puedes sobrescribir este archivo.
Usos del archivo
La siguiente página usa este archivo: