|
|
|
@ -5,6 +5,7 @@ from random import randint
|
|
|
|
|
|
|
|
|
|
windowX = 640 |
|
|
|
|
windowY = 640 |
|
|
|
|
enemy_bul_on_screen = [] |
|
|
|
|
|
|
|
|
|
class Enemy: |
|
|
|
|
def __init__(self): |
|
|
|
@ -20,8 +21,15 @@ class Enemy:
|
|
|
|
|
self.enemy_x += 3 |
|
|
|
|
if self.enemy_x >= 600: |
|
|
|
|
self.enemy_x = 1 |
|
|
|
|
def enemy_shoot(self): #Have NO IDEA how it`ll work |
|
|
|
|
pass |
|
|
|
|
def enemy_shoot(self,window,start_color,bul_image): #Have NO IDEA how it`ll work |
|
|
|
|
new_bullet = Bullet(self.enemy_x + self.en_width/2, self.enemy_y + 10) |
|
|
|
|
enemy_bul_on_screen.append(new_bullet) |
|
|
|
|
if int(len(enemy_bul_on_screen)) > 0: |
|
|
|
|
for bullet in enemy_bul_on_screen: |
|
|
|
|
bullet.draw(window,start_color,bul_image) |
|
|
|
|
bullet.moveb() |
|
|
|
|
if bullet.bullet_y >= windowY +20: |
|
|
|
|
enemy_bul_on_screen.remove(bullet) |
|
|
|
|
|
|
|
|
|
def out_of_area(self): |
|
|
|
|
if self.enemy_x > windowX or self.enemy_x < 0 or self.enemy_y > windowY or self.enemy_y < 0: |
|
|
|
|