Example #1
0
 def in_pipe(self, pipe: Pipe, bird: Bird) -> bool:
     if pipe.position_x <= bird.get_max_x() and pipe.position_x + self.texture["pipe"]["width"] >= bird.get_min_x() \
             and (pipe.bottom >= bird.get_bottom() or bird.get_top() >= pipe.top):
         return True
     return False
Example #2
0
 def in_checkpoint(self, pipe: Pipe, bird: Bird) -> bool:
     if pipe.position_x + self.texture["pipe"]["width"] <= bird.get_min_x() \
             and pipe.bottom < bird.get_bottom() and bird.get_top() < pipe.top:
         return True
     return False