diff --git a/client/svelte-client/src/components/TickWrapper.svelte b/client/svelte-client/src/components/TickWrapper.svelte index 9d65872..f52f342 100644 --- a/client/svelte-client/src/components/TickWrapper.svelte +++ b/client/svelte-client/src/components/TickWrapper.svelte @@ -30,7 +30,7 @@ fn(elapsed / 1_000, dt / 1_000); return; } - + const dtMs = now - lastTime; if (dtMs < frameThreshold) { return; diff --git a/pong/src/pong.rs b/pong/src/pong.rs index 34b553a..6f908ad 100644 --- a/pong/src/pong.rs +++ b/pong/src/pong.rs @@ -72,15 +72,8 @@ pub mod pong_collisions { let bound = RefCell::borrow(&bound); ball.vel_mut().reflect(&bound.orientation()); - // move out of collision - let mut bound_orientation = bound.orientation().clone(); - bound_orientation.switch(); - bound_orientation.abs(); - let mut bound_pos = bound.pos().clone(); - bound_pos.multiply(&bound_orientation); - + let bound_pos = bound.pos().clone(); let mut b_to_a = ball.pos().clone(); - b_to_a.multiply(&bound_orientation); b_to_a.sub(&bound_pos); b_to_a.normalize(); b_to_a.multiply(&ball_dimensions);