diff --git a/Main.py b/Main.py index 778db97..c450e0c 100644 --- a/Main.py +++ b/Main.py @@ -15,25 +15,23 @@ window = pygame.display.set_mode((windowX,windowY)) icon = pygame.image.load('pics/logo.png') pygame.display.set_icon(icon) -######## Images +######## Load Images bullet_image = pygame.image.load('pics/second_bullet.png') enemy_image = pygame.image.load('pics/enemy.png') player_image = pygame.image.load('pics/player.png') -####### +######## #rand_color = (int(random.randint(0,254)),int(random.randint(0,254)) ,int(random.randint(0,254))) -#################################################### Variables -FPS = 70 -clock = pygame.time.Clock() -start_color = (0,0,0) -pygame.mouse.set_visible(False) -enemy = Enemy(100,100,30,60,30,30) -player = Player(300,300,10,64,32,100) -####################################################### -################################################################ MAINLOOP START +################################################################ def play(): - gamerun = True - while gamerun == True: + FPS = 70 + clock = pygame.time.Clock() + start_color = (0,0,0) + pygame.mouse.set_visible(False) + enemy = Enemy(10,random.randint(10,250),30,60,30,30) #(100,100,30,60,30,30) x,y,width,height, damage and health ??? + player = Player(300,300,10,64,32,100) #(300,300,10,64,32,100) x,y,vel,height,width, health ??? + + while True: for event in pygame.event.get(): if event.type == pygame.QUIT: gamerun = False @@ -50,19 +48,21 @@ def play(): enemy.draw(window,start_color,enemy_image) enemy.update() + if player.y == 0: #Just to try a "death" + break + clock.tick(FPS) - pygame.display.update() #Update a display + pygame.display.update() pass -################################################################## MAINLOOP END + +################################################################## def quit(): pygame_menu.events.EXIT sys.exit() -menu_bool = True -while menu_bool == True: +while True: for event in pygame.event.get(): if event.type == pygame.QUIT: - menu_bool = False pygame.quit(),sys.exit() break diff --git a/enemy.py b/enemy.py index 9b595e6..9febfb3 100644 --- a/enemy.py +++ b/enemy.py @@ -1,6 +1,6 @@ import pygame from player import * -from bullets import * +from bullets import Bullet @@ -16,7 +16,7 @@ class Enemy: pygame.draw.rect(window,en_color,(self.enemy_x, self.enemy_y, self.en_width, self.en_height)) window.blit(en_image,(self.enemy_x, self.enemy_y)) def update(self): - self.enemy_x += 3 + self.enemy_x += 3 if self.enemy_x >= 600: self.enemy_x = 1 def enemy_shoot(self): diff --git a/surfaces.py b/surfaces.py index 72ccc1a..8aac7b2 100644 --- a/surfaces.py +++ b/surfaces.py @@ -5,6 +5,9 @@ class surface: self.surf_name = name if self.surf_name == 'kill': killsurf() - + def killsurf(self): pass + + def place(self,name,pos,width,height): + pass