-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Week 24 Exercise #53
Comments
Tab 1; Particle p;
void setup(){
size(1000,750);
p = new Confetti(new PVector(width/2,height/2));
}
void draw(){
background(0);
p.run();
} Tab 2; class Confetti extends Particle{
Confetti(PVector l){
super(l);
}
void display(){
rectMode(CENTER);
fill(175);
stroke(0);
rect(location.x,location.y,7,7);
}
} Tab 3; class Particle{
PVector location;
PVector velocity;
PVector acceleration;
Particle(PVector l){
location = l.get();
velocity = new PVector();
acceleration = new PVector();
}
void display(){
stroke(0);
fill(255);
ellipse(location.x,location.y,7,7);
}
void update(){
location.add(velocity);
velocity.add(acceleration);
}
void run(){
update();
display();
}
} |
Tab one: Particle p;
void setup(){
size(1000,1000);
p = new Confetti(new PVector(width/2, height/2));
}
void draw(){
background(0);
p.run();
} Tab two: class Confetti extends Particle{
Confetti(PVector l){
super(l);
}
void display(){
rectMode(CENTER);
fill(175);
stroke(0);
rect(location.x, location.y, 8, 8);
}
} Tab three: class Particle{
PVector location;
PVector velocity;
PVector acceleration;
Particle(PVector l){
acceleration = new PVector(0, 0.05);
velocity = new PVector(random(-1, 1), random(-2, 0));
location = l.get();
}
void run(){
update();
display();
}
void update(){
velocity.add(acceleration);
location.add(velocity);
}
void display(){
fill(0);
ellipse(location.x, location.y, 8, 8);
}
} |
Particle p; p = new Confetti(new PVector(400,200)); |
class Confetti extends Particle { Confetti(PVector l){ |
class Particle{ Particle(PVector l){ void run(){ void update(){ void display(){ |
I might be running a few minutes late today there were a few accidents. |
The text was updated successfully, but these errors were encountered: