mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Examples updated accordingly
This commit is contained in:
@@ -11,7 +11,8 @@ class Particle {
|
||||
|
||||
Particle() {
|
||||
partSize = random(10,60);
|
||||
part = createShape(QUAD);
|
||||
part = createShape();
|
||||
part.beginShape(QUAD);
|
||||
part.noStroke();
|
||||
part.texture(sprite);
|
||||
part.normal(0, 0, 1);
|
||||
@@ -19,7 +20,7 @@ class Particle {
|
||||
part.vertex(+partSize/2, -partSize/2, sprite.width, 0);
|
||||
part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height);
|
||||
part.vertex(-partSize/2, +partSize/2, 0, sprite.height);
|
||||
part.end();
|
||||
part.endShape();
|
||||
|
||||
rebirth(width/2,height/2);
|
||||
lifespan = random(255);
|
||||
@@ -52,7 +53,7 @@ class Particle {
|
||||
lifespan = lifespan - 1;
|
||||
velocity.add(gravity);
|
||||
|
||||
part.tint(255,lifespan);
|
||||
part.setTint(color(255,lifespan));
|
||||
part.translate(velocity.x, velocity.y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user