Unbewohnte
4 years ago
5 changed files with 60 additions and 19 deletions
@ -0,0 +1,9 @@ |
|||||||
|
import pygame |
||||||
|
|
||||||
|
############ imgs for player-enemy(self,bullet), surfaces |
||||||
|
bullet_image = pygame.image.load('pics/second_bullet.png') |
||||||
|
enemy_bul_img = pygame.image.load('pics/bullet.png') |
||||||
|
enemy_image = pygame.image.load('pics/32x64.png') |
||||||
|
player_image = pygame.image.load('pics/32x64.png') |
||||||
|
timesurf_image = pygame.image.load('pics/timesurf.png') |
||||||
|
############ |
After Width: | Height: | Size: 17 KiB |
@ -1,12 +1,30 @@ |
|||||||
import pygame |
import pygame |
||||||
from beings import * |
from beings import * |
||||||
|
from images import timesurf_image |
||||||
class Surface: |
class Surface: |
||||||
def __init__(self,name): |
def __init__(self,surf_x,surf_y): |
||||||
if str(name) == 'killsurf': |
self.x = surf_x |
||||||
self.width = windowX |
self.y = surf_y |
||||||
self.height = windowY |
self.width = 32 |
||||||
|
self.height = 64 |
||||||
self.color = (30,70,40) |
self.color = (30,70,40) |
||||||
|
self.rect = pygame.Rect(self.x,self.y,self.width,self.height,) |
||||||
def place(self,window,surf_x,surf_y): |
def place(self,window,surf_x,surf_y): |
||||||
pygame.draw.rect(window,self.color,(surf_x,surf_y,self.width,self.height)) |
pygame.draw.rect(window,self.color,self.rect) |
||||||
|
|
||||||
|
class SlowTimeSurf: |
||||||
|
def __init__(self,surf_x,surf_y): |
||||||
|
self.x = surf_x |
||||||
|
self.y = surf_y |
||||||
|
self.width = 32 |
||||||
|
self.height = 64 |
||||||
|
self.color = (0,0,0) |
||||||
|
self.rect = pygame.Rect(self.x, self.y, self.width, self.height) |
||||||
|
def place(self,window): |
||||||
|
pygame.draw.rect(window,self.color,self.rect) |
||||||
|
window.blit(timesurf_image,(self.rect[0], self.rect[1])) |
||||||
|
def collide(self,object): |
||||||
|
if self.rect.colliderect(object): |
||||||
|
return True |
||||||
|
else: |
||||||
|
return False |
||||||
|
Loading…
Reference in new issue