Browse Source

Small fixes and improvements

master
Unbewohnte 4 years ago
parent
commit
26fbf39f28
  1. 3
      Main.py
  2. 2
      beings.py
  3. 1
      bullets.py

3
Main.py

@ -1,8 +1,6 @@
import pygame import pygame
import pygame_menu import pygame_menu
import sys import sys
import random
import time
from bullets import Bullet from bullets import Bullet
from beings import * from beings import *
from surfaces import Surface from surfaces import Surface
@ -21,7 +19,6 @@ font = pygame.font.Font('freesansbold.ttf', 46)
def play(): def play():
FPS = 70 FPS = 70
clock = pygame.time.Clock() clock = pygame.time.Clock()
start_color = (0,0,0)
pygame.mouse.set_visible(False) pygame.mouse.set_visible(False)
enemy = Enemy() enemy = Enemy()
player = Player() player = Player()

2
beings.py

@ -8,7 +8,7 @@ import sys
############ ############
windowX = 832 windowX = 832
windowY = 832 windowY = 832
############ imgs for player-enemy(self,bullet)
bullet_image = pygame.image.load('pics/second_bullet.png') bullet_image = pygame.image.load('pics/second_bullet.png')
enemy_bul_img = pygame.image.load('pics/bullet.png') enemy_bul_img = pygame.image.load('pics/bullet.png')
enemy_image = pygame.image.load('pics/32x64.png') enemy_image = pygame.image.load('pics/32x64.png')

1
bullets.py

@ -12,6 +12,7 @@ class Bullet:
self.bullet_width = 4 self.bullet_width = 4
self.bullet_height = 12 self.bullet_height = 12
self.bullet_vel = random.randint(16,28) #12 -- 22 self.bullet_vel = random.randint(16,28) #12 -- 22
self.bullet_rect = pygame.Rect(self.bullet_x,self.bullet_y, self.bullet_width,self.bullet_height)
def draw(self,window,start_color,bullet_image): def draw(self,window,start_color,bullet_image):
self.rect = pygame.draw.rect(window,start_color,(self.bullet_x,self.bullet_y,self.bullet_width,self.bullet_height)) self.rect = pygame.draw.rect(window,start_color,(self.bullet_x,self.bullet_y,self.bullet_width,self.bullet_height))
window.blit(bullet_image,(self.bullet_x, self.bullet_y)) window.blit(bullet_image,(self.bullet_x, self.bullet_y))

Loading…
Cancel
Save