MCPcopy Create free account
hub / github.com/geekcomputers/Python / Bird

Class Bird

Flappy Bird - created with tkinter/Flappy Bird.py:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19# Bird class
20class Bird:
21 def __init__(self):
22 self.image = bird_image
23 self.x = 50
24 self.y = screen_height // 2
25 self.vel = 0
26 self.gravity = 1
27
28 def update(self):
29 self.vel += self.gravity
30 self.y += self.vel
31
32 def flap(self):
33 self.vel = -10
34
35 def draw(self, screen):
36 screen.blit(self.image, (self.x, self.y))
37
38
39# Pipe class

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected