Skip to content
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

Open
chasestarr opened this issue Apr 27, 2016 · 6 comments
Open

Week 24 Exercise #53

chasestarr opened this issue Apr 27, 2016 · 6 comments

Comments

@chasestarr
Copy link
Member

chasestarr commented Apr 27, 2016

screenshot 2016-04-27 11 00 32

screenshot 2016-04-27 11 01 46

@Brandonsugar
Copy link

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();
  }
}

@GoHawks12
Copy link

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);
  }
}

@The-Space-Core
Copy link

Particle p;
Confetti c;
void setup(){
size(800,800);

p = new Confetti(new PVector(400,200));
}
void draw(){
p.update();
background(255);
p.run();
p.display();
}

@The-Space-Core
Copy link

class Confetti extends Particle {

Confetti(PVector l){
super(l);
}
void display(){
rectMode(CENTER);
fill(0);
stroke(0);
rect(location.x,location.y,8,8);
}
}

@The-Space-Core
Copy link

class Particle{
PVector location;
PVector velocity;
PVector acceleration;

Particle(PVector l){
acceleration = new PVector(0, 0.05);
velocity = new PVector(random(-1, 1), random(-12, 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);
}
}

@chasestarr chasestarr mentioned this issue May 2, 2016
@GoHawks12
Copy link

I might be running a few minutes late today there were a few accidents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants