class Moving { // fields PVector pos, vel, acc; //PVector to store position, velocity and acceleration valuse float damp = 0.7; float radius; int bloodFore = 100; int bloodForb = 200; int bloodForfe =120; Moving(PVector pos) { this.pos = pos; vel = new PVector(0, 0); acc = new PVector(-1, 0); } void update() { vel.add(acc); vel.mult(damp); pos.add(vel); acc.set(0, 0, 0); } void move(PVector force) { acc.add(force); } boolean collision(Moving other) { if (dist(pos.x, pos.y, other.pos.x, other.pos.y) < radius + other.radius) { return true; } return false; } }