diff --git a/bullet.py b/bullet.py new file mode 100644 index 0000000..a41264d --- /dev/null +++ b/bullet.py @@ -0,0 +1,14 @@ +from dinosaur import * + +class Bullet: + def __init__(self, game_speed, dinosaur): + self.game_speed = game_speed + self.image = BULLET + self.rect = self.image.get_rect() + self.rect.x = dinosaur.dino_rect.x + dinosaur.dino_rect[2] + 10 + self.rect.y = dinosaur.dino_rect.y + dinosaur.dino_rect[3] / 2 + + def update(self): + self.rect.x += self.game_speed + def draw(self,SCREEN): + SCREEN.blit(self.image, (self.rect.x, self.rect.y)) \ No newline at end of file