2022-03-09 21:27:57 +01:00
|
|
|
import pygame
|
2022-03-09 22:19:04 +01:00
|
|
|
from map import preparedMap
|
2022-03-09 22:39:34 +01:00
|
|
|
from agent import trashmaster
|
|
|
|
|
2022-03-10 15:53:41 +01:00
|
|
|
|
|
|
|
class WalleGame():
|
|
|
|
def __init__(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-09 21:27:57 +01:00
|
|
|
pygame.init()
|
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
#config
|
|
|
|
SCREEN_SIZE = [512, 512]
|
|
|
|
BACKGROUND_COLOR = '#ffffff'
|
2022-03-09 21:27:57 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
if __name__ == '__main__':
|
2022-03-09 21:27:57 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
pygame.init()
|
2022-03-09 21:27:57 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
# tytul okna
|
|
|
|
pygame.display.set_caption('Wall-e')
|
2022-03-09 22:39:34 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
screen = pygame.display.set_mode(SCREEN_SIZE)
|
|
|
|
screen.fill(pygame.Color(BACKGROUND_COLOR))
|
2022-03-09 22:39:34 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
# krata
|
|
|
|
map = preparedMap(SCREEN_SIZE)
|
|
|
|
screen.blit(map, (0,0))
|
2022-03-09 21:27:57 +01:00
|
|
|
|
2022-03-09 22:19:04 +01:00
|
|
|
# update okna
|
|
|
|
pygame.display.update()
|
2022-03-09 21:27:57 +01:00
|
|
|
|
2022-03-09 22:39:34 +01:00
|
|
|
smieciara1 = trashmaster()
|
|
|
|
smieciara_list = pygame.sprite.Group()
|
|
|
|
smieciara_list.add(smieciara1)
|
|
|
|
smieciara_list.draw(screen)
|
|
|
|
|
2022-03-09 21:27:57 +01:00
|
|
|
pygame.display.update()
|
|
|
|
|
|
|
|
running = True
|
|
|
|
while running:
|
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
running = False
|
|
|
|
|
|
|
|
|
2022-03-09 21:37:03 +01:00
|
|
|
pygame.quit()
|