airplane.py 489 B

123456789101112131415161718192021222324252627
  1. #-*- coding: UTF-8 -*-
  2. import pygame
  3. import tkinter
  4. import os
  5. import sys
  6. import random
  7. from flyingObject import FlyingObject
  8. from enemy import Enemy
  9. class Airplane(FlyingObject,Enemy):
  10. def __init__(self,screen,image):
  11. x = random.randint(0,screen,image)
  12. y = -40
  13. super(Airplane,self).__init__(screen,x,y,image)
  14. def getScore(self):
  15. return 5
  16. def outOfBounds(self):
  17. return self.y < 715
  18. def step(self):
  19. self.y += 3