bee.py 647 B

1234567891011121314151617181920212223242526272829
  1. #-*- coding: UTF-8 -*-
  2. import pygame
  3. import os
  4. import sys
  5. import random
  6. from flyingObject import FlyingObject
  7. from award import Award
  8. class Bee(FlyingObject,Award):
  9. def __init__(self,screen,image):
  10. x = random.randint(0,screen.get_rect()[2]-60)
  11. y = -50
  12. super(Bee,self).__init__(screen,x,y,image)
  13. self.awardType = random.randint(0,1)
  14. self.index = True
  15. def outOfBounds(self):
  16. return self.y < 715
  17. def step(self):
  18. if self.x + self.width > 480:
  19. self.x += 3
  20. else:
  21. self.x -= 3
  22. self.y += 3
  23. def getType(self):
  24. return self.awardType