import pygame


class BaseClass(pygame.sprite.Sprite):
	all_sprites = pygame.sprite.Group()

	def __init__(self, x, y, image_string):
		pygame.sprite.Sprite.__init__(self)
		BaseClass.all_sprites.add(self)

		self.image = pygame.image.load(image_string)
		self.rect = self.image.get_rect()
		self.rect.x = x
		self.rect.y = y

		self.rect.width
		self.rect.height 


class Player(BaseClass):
	List = pygame.sprite.Group()

	def __init__(self, x, y, image_string):
		BaseClass.__init__(self, x, y, image_string)
		Player.List.add(self)
		self.velx, self.vely = 0, 0


	def motion(self, SCREENWIDTH, SCREENHEIGHT):
		predicted_x_location = self.rect.x + self.velx
		predicted_y_location = self.rect.y + self.vely

		if predicted_x_location < 0:
			self.velx = 0
		elif predicted_x_location + self.rect.width > SCREENWIDTH:
			self.velx = 0
		elif predicted_y_location < 0:
			self.vely = 0
		elif predicted_y_location + self.rect.height > SCREENHEIGHT:
			self.vely = 0
		else:
			self.rect.x += self.velx
			self.rect.y += self.vely

















@@ -6,17 +6,23 @@
 t pygame
+, math
 %0A
-
 %0A%0Aclass 
@@ -365,16 +365,126 @@
 eight %0A%0A
+%09def destroy(self, ClassName):%0A%09%09ClassName.List.remove(self)%0A%09%09BaseClass.all_sprites.remove(self)%0A%09%09del self%0A%0A
 %0Aclass P
@@ -1113,16 +1113,16 @@
 lf.velx%0A
-
 %09%09%09self.
@@ -1143,16 +1143,1118 @@
 .vely%0A%0A%0A
+class Flight(BaseClass):%0A%09List = pygame.sprite.Group()%0A%09def __init__(self, x, y, image_string):%0A%09%09BaseClass.__init__(self, x, y, image_string)%0A%09%09Flight.List.add(self)%0A%09%09self.health = 100%0A%09%09self.velx, self.vely = 0, 2%0A%0A%09def fly(self, SCREENHEIGHT):%0A%09%09self.rect.y += self.vely%0A%0A%0A%09@staticmethod%0A%09def update(SCREENHEIGHT):%0A%09%09for flight in Flight.List:%0A%09%09%09flight.fly(SCREENHEIGHT)%0A%0A%09%09%09if flight.rect.y %3E SCREENHEIGHT:%0A%09%09%09%09flight.destroy(Flight)%0A%0A%0A%0Aclass Bullet(pygame.sprite.Sprite):%0A%09List = pygame.sprite.Group()%0A%09spare_list = %5B%5D%0A%0A%09def __init__(self, x, y, image_string):%0A%09%09pygame.sprite.Sprite.__init__(self)%0A%09%09self.image = pygame.image.load(image_string)%0A%0A%09%09self.rect = self.image.get_rect()%0A%09%09self.rect.x = x%0A%09%09self.rect.y = y%0A%09%09self.velx, self.vely = 0, -15%0A%0A%09%09try:%0A%09%09%09last_element = Bullet.spare_list%5B-1%5D%0A%09%09%09difference = abs(self.rect.y - last_element.rect.y)%0A%0A%09%09%09if difference %3C self.rect.height+20:%0A%09%09%09%09return%0A%09%09except Exception:%0A%09%09%09pass%0A%0A%09%09Bullet.spare_list.append(self)%0A%09%09Bullet.List.add(self)%0A%0A%0A%09@staticmethod%0A%09def movement():%0A%09%09for bullet in Bullet.List:%0A%09%09%09bullet.rect.y += bullet.vely%0A%0A%0A%0A%0A%0A%0A%0A%0A
 %0A%0A%0A%0A%0A%0A%0A%0A

add bullet and enemy