Browse Source

Fixes

master
Unbewohnte 4 years ago
parent
commit
1626ef1da4
  1. 36
      Main.py
  2. 2
      enemy.py
  3. 3
      surfaces.py

36
Main.py

@ -15,25 +15,23 @@ window = pygame.display.set_mode((windowX,windowY))
icon = pygame.image.load('pics/logo.png') icon = pygame.image.load('pics/logo.png')
pygame.display.set_icon(icon) pygame.display.set_icon(icon)
######## Images ######## Load Images
bullet_image = pygame.image.load('pics/second_bullet.png') bullet_image = pygame.image.load('pics/second_bullet.png')
enemy_image = pygame.image.load('pics/enemy.png') enemy_image = pygame.image.load('pics/enemy.png')
player_image = pygame.image.load('pics/player.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))) #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(): def play():
gamerun = True FPS = 70
while gamerun == True: 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(): for event in pygame.event.get():
if event.type == pygame.QUIT: if event.type == pygame.QUIT:
gamerun = False gamerun = False
@ -50,19 +48,21 @@ def play():
enemy.draw(window,start_color,enemy_image) enemy.draw(window,start_color,enemy_image)
enemy.update() enemy.update()
if player.y == 0: #Just to try a "death"
break
clock.tick(FPS) clock.tick(FPS)
pygame.display.update() #Update a display pygame.display.update()
pass pass
################################################################## MAINLOOP END
##################################################################
def quit(): def quit():
pygame_menu.events.EXIT pygame_menu.events.EXIT
sys.exit() sys.exit()
menu_bool = True while True:
while menu_bool == True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == pygame.QUIT: if event.type == pygame.QUIT:
menu_bool = False
pygame.quit(),sys.exit() pygame.quit(),sys.exit()
break break

2
enemy.py

@ -1,6 +1,6 @@
import pygame import pygame
from player import * from player import *
from bullets import * from bullets import Bullet

3
surfaces.py

@ -8,3 +8,6 @@ class surface:
def killsurf(self): def killsurf(self):
pass pass
def place(self,name,pos,width,height):
pass

Loading…
Cancel
Save