xxxxxxxxxx
Particle floater;
float hitDistance = 50;
void setup() {
size( 600, 800);
floater = new Particle(width/2, height/2);
floater.gravity = new PVector(0, -.1);
floater.fillColor = color(#3DCB33);
}
void draw() {
background(0);
floater.update();
floater.display();
//draw hitbox around the particle
noFill();
stroke(255, 0, 0);
ellipse(floater.pos.x, floater.pos.y, hitDistance, hitDistance);
}
void mousePressed() {
if ( dist(mouseX, mouseY, floater.pos.x, floater.pos.y) < hitDistance) {
floater.addForce( 0, 10 );
}
}