#-*- coding: UTF-8 -*- import tkinter import pygame import os import sys import time import abc class FlyingObject(object): def __init__(self,screen,x,y,image): self.screen = screen self.x = x self.y = y self.width = image.get_rect()[2] self.height = image.get_rect()[3] self.image = image @abc.abstractmethod def outOfBounds(self): pass @abc.abstractmethod def step(self): pass def shootBy(self,bullet): x1 = self.x x2 = self.x + self.width y1 = self.y y2 = self.y + self.height x = bullet.x y = bullet.y return x>x1 and xy1 and y