doddany folder resources
16
game.py
@ -6,7 +6,7 @@ class Smieciarka(pygame.sprite.Sprite):
|
|||||||
def __init__(self, x, y):
|
def __init__(self, x, y):
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.image = pygame.image.load('smieciarka.png')
|
self.image = pygame.image.load('resources/smieciarka.png')
|
||||||
self.ruch = 0
|
self.ruch = 0
|
||||||
pygame.sprite.Sprite.__init__(self)
|
pygame.sprite.Sprite.__init__(self)
|
||||||
self.rect = pygame.Rect(self.x * WIDTH + MARGIN * self.x + MARGIN, self.y * HEIGHT + MARGIN * self.y, WIDTH,
|
self.rect = pygame.Rect(self.x * WIDTH + MARGIN * self.x + MARGIN, self.y * HEIGHT + MARGIN * self.y, WIDTH,
|
||||||
@ -17,7 +17,7 @@ class Smieciarka(pygame.sprite.Sprite):
|
|||||||
self.x -= 1
|
self.x -= 1
|
||||||
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
|
self.rect.x = MARGIN + self.x * WIDTH + self.x * MARGIN
|
||||||
if self.ruch == 2:
|
if self.ruch == 2:
|
||||||
self.image = pygame.image.load('smieciarka.png')
|
self.image = pygame.image.load('resources/smieciarka.png')
|
||||||
self.ruch = 1
|
self.ruch = 1
|
||||||
|
|
||||||
def w_prawo(self):
|
def w_prawo(self):
|
||||||
@ -92,15 +92,15 @@ clock = pygame.time.Clock()
|
|||||||
|
|
||||||
smieciarka = Smieciarka(10, 10)
|
smieciarka = Smieciarka(10, 10)
|
||||||
kontener_plastik = Kontener(0, 0)
|
kontener_plastik = Kontener(0, 0)
|
||||||
kontener_plastik.image = pygame.image.load("pojemnik_plastik.png")
|
kontener_plastik.image = pygame.image.load("resources/pojemnik_plastik.png")
|
||||||
kontener_metal = Kontener(0, 4)
|
kontener_metal = Kontener(0, 4)
|
||||||
kontener_metal.image = pygame.image.load("pojemnik_metal.png")
|
kontener_metal.image = pygame.image.load("resources/pojemnik_metal.png")
|
||||||
kontener_organiczne = Kontener(2, 2)
|
kontener_organiczne = Kontener(2, 2)
|
||||||
kontener_organiczne.image = pygame.image.load("pojemnik_organiczne.png")
|
kontener_organiczne.image = pygame.image.load("resources/pojemnik_organiczne.png")
|
||||||
kontener_papier = Kontener(4, 0)
|
kontener_papier = Kontener(4, 0)
|
||||||
kontener_papier.image = pygame.image.load("pojemnik_papier.png")
|
kontener_papier.image = pygame.image.load("resources/pojemnik_papier.png")
|
||||||
kontener_szklo = Kontener(4, 4)
|
kontener_szklo = Kontener(4, 4)
|
||||||
kontener_szklo.image = pygame.image.load("pojemnik_szklo.png")
|
kontener_szklo.image = pygame.image.load("resources/pojemnik_szklo.png")
|
||||||
|
|
||||||
kontener_list = pygame.sprite.Group()
|
kontener_list = pygame.sprite.Group()
|
||||||
smieciarka_list = pygame.sprite.Group()
|
smieciarka_list = pygame.sprite.Group()
|
||||||
@ -149,7 +149,7 @@ while not done:
|
|||||||
(MARGIN + HEIGHT) * row + MARGIN,
|
(MARGIN + HEIGHT) * row + MARGIN,
|
||||||
WIDTH,
|
WIDTH,
|
||||||
HEIGHT])
|
HEIGHT])
|
||||||
screen.blit(pygame.image.load("wysypisko.jpg"), (5, 5))
|
screen.blit(pygame.image.load("resources/wysypisko.jpg"), (5, 5))
|
||||||
all_sprites_list.draw(screen)
|
all_sprites_list.draw(screen)
|
||||||
|
|
||||||
# Limit to 60 frames per second
|
# Limit to 60 frames per second
|
||||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |