Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions FBAI.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ def draw(self, win):

def collide(self, bird, win):

bird_mask = bird.get_mask()
top_mask = pygame.mask.from_surface(self.PIPE_TOP)
bottom_mask = pygame.mask.from_surface(self.PIPE_BOTTOM)
top_offset = (self.x - bird.x, self.top - round(bird.y))
bottom_offset = (self.x - bird.x, self.bottom - round(bird.y))

b_point = bird_mask.overlap(bottom_mask, bottom_offset)
t_point = bird_mask.overlap(top_mask,top_offset)

if b_point or t_point:
return True

Expand Down Expand Up @@ -347,4 +338,4 @@ def run(config_file):
# here so that the script will run successfully.
local_dir = os.path.dirname(__file__)
config_path = os.path.join(local_dir, 'CONFIG.txt')
run(config_path)
run(config_path)