fn is_hit(&self, other: &Object) -> bool {
        let (result_x, result_y) = (self.current_state.0 - other.current_state.0,
                                    self.current_state.1 - other.current_state.1);
        match (result_x < 0.0, result_y < 0.0) {
            (false, false) => result_x <= other.size.0 && result_y <= other.size.1,
            (true, false) => result_x.abs() <= self.size.0 && result_y <= other.size.1,
            (false, true) => result_x <= other.size.0 && result_y.abs() <= self.size.1,
            (true, true) => result_x.abs() <= self.size.0 && result_y.abs() <= self.size.1,
        }
    }
// if object hit with other object then return true
if object hit with other object then return true
if object hit with other object then return true
fn is_hit(&self, other: &Object) -> bool {
        let (result_x, result_y) = (self.current_state.0 - other.current_state.0,
                                    self.current_state.1 - other.current_state.1);
        match (result_x < 0.0, result_y < 0.0) {
            (false, false) => result_x <= other.size.0 && result_y <= other.size.1,
            (true, false) => result_x.abs() <= self.size.0 && result_y <= other.size.1,
            (false, true) => result_x <= other.size.0 && result_y.abs() <= self.size.1,
            (true, true) => result_x.abs() <= self.size.0 && result_y.abs() <= self.size.1,
        }
    }
fn is_hit ( & self , other : & Object ) -> bool { let ( result_x , result_y ) = ( self . current_state . 0 - other . current_state . 0 , self . current_state . 1 - other . current_state . 1 ) ; match ( result_x < 0.0 , result_y < 0.0 ) { ( false , false ) => result_x <= other . size . 0 && result_y <= other . size . 1 , ( true , false ) => result_x . abs ( ) <= self . size . 0 && result_y <= other . size . 1 , ( false , true ) => result_x <= other . size . 0 && result_y . abs ( ) <= self . size . 1 , ( true , true ) => result_x . abs ( ) <= self . size . 0 && result_y . abs ( ) <= self . size . 1 , } }
if object hit with other object then return true
if object hit with other object then return true
&self
other
&Object
&self
other
&Object