agent_model
This commit is contained in:
commit
d14bcc1cad
34
main.py
34
main.py
@ -1,29 +1,29 @@
|
|||||||
import pygame
|
import pygame
|
||||||
|
from map import preparedMap
|
||||||
from agent import trashmaster
|
from agent import trashmaster
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pygame.init()
|
pygame.init()
|
||||||
|
|
||||||
|
#config
|
||||||
|
SCREEN_SIZE = [512, 512]
|
||||||
|
BACKGROUND_COLOR = '#ffffff'
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
pygame.init()
|
||||||
|
|
||||||
|
# tytul okna
|
||||||
pygame.display.set_caption('Wall-e')
|
pygame.display.set_caption('Wall-e')
|
||||||
|
|
||||||
screen = pygame.display.set_mode([512, 512])
|
screen = pygame.display.set_mode(SCREEN_SIZE)
|
||||||
screen.fill(pygame.Color('#ffffff'))
|
screen.fill(pygame.Color(BACKGROUND_COLOR))
|
||||||
|
|
||||||
|
# krata
|
||||||
|
map = preparedMap(SCREEN_SIZE)
|
||||||
|
screen.blit(map, (0,0))
|
||||||
|
|
||||||
tileImage = pygame.image.load('tile1.png')
|
# update okna
|
||||||
|
pygame.display.update()
|
||||||
surfaceSize = width, height = (512, 512)
|
|
||||||
surface = pygame.Surface(surfaceSize)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for x in range(0, 512, 16):
|
|
||||||
for y in range(0, 512, 16):
|
|
||||||
surface.blit(tileImage, (x, y))
|
|
||||||
|
|
||||||
screen.blit(surface, (0,0))
|
|
||||||
|
|
||||||
smieciara1 = trashmaster()
|
smieciara1 = trashmaster()
|
||||||
smieciara_list = pygame.sprite.Group()
|
smieciara_list = pygame.sprite.Group()
|
||||||
|
13
map.py
Normal file
13
map.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import pygame
|
||||||
|
|
||||||
|
# config
|
||||||
|
TILE_SIZE = 16
|
||||||
|
|
||||||
|
def preparedMap(screenSize):
|
||||||
|
tileImage = pygame.image.load('tile1.png')
|
||||||
|
surface = pygame.Surface(screenSize)
|
||||||
|
|
||||||
|
for x in range(0, screenSize[0], TILE_SIZE):
|
||||||
|
for y in range(0, screenSize[1], TILE_SIZE):
|
||||||
|
surface.blit(tileImage, (x, y))
|
||||||
|
return surface
|
Loading…
Reference in New Issue
Block a user