fn stay_in_view(&self, x: f64, y: f64) -> (f64, f64) {
        let mut x = x;
        let mut y = y;

        if x > self.width as f64 {
            x -= self.width as f64;
        } else if x < 0.0 {
            x += self.width as f64;
        }

        if y > self.height as f64 {
            y -= self.height as f64;
        } else if y < 0.0 {
            y += self.height as f64;
        }

        (x, y)
    }
// make sure the boid stays inside the current view frame
make sure the boid stays inside the current view frame
make sure the boid stays inside the current view frame
fn stay_in_view(&self, x: f64, y: f64) -> (f64, f64) {
        let mut x = x;
        let mut y = y;
        if x > self.width as f64 {
            x -= self.width as f64;
        } else if x < 0.0 {
            x += self.width as f64;
        }
        if y > self.height as f64 {
            y -= self.height as f64;
        } else if y < 0.0 {
            y += self.height as f64;
        }
        (x, y)
    }
fn stay_in_view ( & self , x : f64 , y : f64 ) -> ( f64 , f64 ) { let mut x = x ; let mut y = y ; if x > self . width as f64 { x -= self . width as f64 ; } else if x < 0.0 { x += self . width as f64 ; } if y > self . height as f64 { y -= self . height as f64 ; } else if y < 0.0 { y += self . height as f64 ; } ( x , y ) }
make sure the boid stays inside the current view frame
make sure the boid stays inside the current view frame
&self
x
f64
y
f64
&self
x
f64
y
f64