fn reset(&mut self) {
        // set pos back to home
        self.pos = self.home;
        // randomize the velocity vector
        self.vel.x = match fastrand::bool() {
            true => BALL_SPEED,
            false => -BALL_SPEED,
        };
        self.vel.y = match fastrand::bool() {
            true => BALL_SPEED,
            false => -BALL_SPEED,
        };
    }
// Reset the ball back to the home position
Reset the ball back to the home position
Reset the ball back to the home position
fn reset(&mut self) {
        // set pos back to home
        self.pos = self.home;
        // randomize the velocity vector
        self.vel.x = match fastrand::bool() {
            true => BALL_SPEED,
            false => -BALL_SPEED,
        };
        self.vel.y = match fastrand::bool() {
            true => BALL_SPEED,
            false => -BALL_SPEED,
        };
    }
fn reset ( & mut self ) { // set pos back to home self . pos = self . home ; // randomize the velocity vector self . vel . x = match fastrand :: bool ( ) { true => BALL_SPEED , false => - BALL_SPEED , } ; self . vel . y = match fastrand :: bool ( ) { true => BALL_SPEED , false => - BALL_SPEED , } ; }
Reset the ball back to the home position
Reset the ball back to the home position
&mut self
&mut self