From 0edca43510ccd81dff5cbc9b2543d652f402cd59 Mon Sep 17 00:00:00 2001 From: Daniel Shiffman Date: Sat, 16 Mar 2013 22:45:01 -0400 Subject: [PATCH] tiny reflection2 fix --- java/examples/Topics/Motion/Reflection2/Orb.pde | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/examples/Topics/Motion/Reflection2/Orb.pde b/java/examples/Topics/Motion/Reflection2/Orb.pde index ab033a911..a3e0d534a 100644 --- a/java/examples/Topics/Motion/Reflection2/Orb.pde +++ b/java/examples/Topics/Motion/Reflection2/Orb.pde @@ -26,13 +26,11 @@ class Orb { void checkWallCollision() { if (position.x > width-r) { position.x = width-r; - velocity.x *= -1; - velocity.x *= damping; + velocity.x *= -damping; } else if (position.x < r) { position.x = r; - velocity.x *= -1; - velocity.x *= damping; + velocity.x *= -damping; } }