comments reflection2

This commit is contained in:
Daniel Shiffman
2013-03-18 15:42:25 -04:00
parent 6e58223c95
commit 4754ec6adc
3 changed files with 16 additions and 12 deletions
@@ -1,7 +1,9 @@
class Orb {
// Orb has positio and velocity
PVector position;
PVector velocity;
float r;
// A damping of 80% slows it down when it hits the ground
float damping = 0.8;
Orb(float x, float y, float r_) {
@@ -22,7 +24,8 @@ class Orb {
fill(200);
ellipse(position.x, position.y, r*2, r*2);
}
// Check boundaries of window
void checkWallCollision() {
if (position.x > width-r) {
position.x = width-r;