Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
updated code according to PEP8
  • Loading branch information
itspyguru committed Oct 4, 2021
commit cfee1713f0b0688abfed0c99db8f56ccd7896b2a
8 changes: 2 additions & 6 deletions Code-Sleep-Python/Flappy Bird/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
SCREEN = WIDTH, HEIGHT = 288, 512
display_height = 0.80 * HEIGHT
info = pygame.display.Info()

width = info.current_w
height = info.current_h

Expand All @@ -19,7 +18,6 @@
win = pygame.display.set_mode(
SCREEN, pygame.NOFRAME | pygame.SCALED | pygame.FULLSCREEN)

# win = pygame.display.set_mode(SCREEN, pygame.SCALED | pygame.FULLSCREEN)
clock = pygame.time.Clock()
FPS = 60

Expand All @@ -35,7 +33,6 @@
bg2 = pygame.image.load('Assets/background-night.png')

bg = random.choice([bg1, bg2])

im_list = [pygame.image.load('Assets/pipe-green.png'),
pygame.image.load('Assets/pipe-red.png')]
pipe_img = random.choice(im_list)
Expand Down Expand Up @@ -80,7 +77,6 @@
speed = 0
grumpy.draw_flap()
base.update(speed)

win.blit(flappybird_img, (40, 50))
else:

Expand Down Expand Up @@ -118,8 +114,8 @@

if len(pipe_group) > 0:
p = pipe_group.sprites()[0]
if (grumpy.rect.left > p.rect.left and
grumpy.rect.right < p.rect.right and not pipe_pass
if (grumpy.rect.left > p.rect.left and
grumpy.rect.right < p.rect.right and not pipe_pass
and grumpy.alive):
pipe_pass = True

Expand Down