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

Class Pipe

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

Source from the content-addressed store, hash-verified

38
39# Pipe class
40class Pipe:
41 def __init__(self):
42 self.image = pipe_image
43 self.x = screen_width
44 self.y = random.randint(150, screen_height - 150)
45 self.vel = 5
46
47 def update(self):
48 self.x -= self.vel
49
50 def draw(self, screen):
51 screen.blit(self.image, (self.x, self.y))
52 screen.blit(
53 pygame.transform.flip(self.image, False, True),
54 (self.x, self.y - screen_height),
55 )
56
57
58def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected