Trashmaster/main.py

54 lines
1.3 KiB
Python
Raw Normal View History

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
2022-03-10 16:16:59 +01:00
class WalleGame():
def __init__(self):
self.SCREEN_SIZE = [512, 512]
self.BACKGROUND_COLOR = '#ffffff'
pygame.init()
pygame.display.set_caption('Wall-e')
2022-03-10 16:18:06 +01:00
self.screen = pygame.display.set_mode(self.SCREEN_SIZE)
2022-03-10 16:16:59 +01:00
self.screen.fill(pygame.Color(self.BACKGROUND_COLOR))
# krata
self.map = preparedMap(self.SCREEN_SIZE)
self.screen.blit(self.map, (0,0))
def update_window(self):
pygame.display.update()
def draw_trashmaster(self, smieciara: trashmaster):
smieciara_list = pygame.sprite.Group()
smieciara_list.add(smieciara)
smieciara_list.draw(self.screen)
def main():
game = WalleGame()
game.update_window()
2022-03-11 13:00:11 +01:00
smieciara_object = trashmaster(16,16,"resources/textures/trashmaster_blu.png",16)
2022-03-10 16:16:59 +01:00
game.draw_trashmaster(smieciara_object)
2022-03-09 22:39:34 +01:00
2022-03-10 16:16:59 +01:00
game.update_window()
2022-03-09 21:27:57 +01:00
2022-03-10 16:16:59 +01:00
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()
pygame.quit()
2022-03-09 21:27:57 +01:00
2022-03-10 16:16:59 +01:00
if __name__ == '__main__':
main()