agent_model

This commit is contained in:
Kacper 2022-03-09 22:39:34 +01:00
parent 70e4b7ba69
commit b701bebf83
5 changed files with 28 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

15
agent.py Normal file
View File

@ -0,0 +1,15 @@
import pygame.image
class trashmaster(pygame.sprite.Sprite):
def __init__(self):
super().__init__()
self.images = []
self.image = pygame.image.load("resources/textures/trashmaster_blu.png")
self.image = pygame.transform.scale(self.image, (16, 16))
self.images.append(self.image)
self.rect = self.image.get_rect()
garbagetruck_list = pygame.sprite.Group()

14
main.py
View File

@ -1,4 +1,9 @@
import pygame import pygame
from agent import trashmaster
pygame.init() pygame.init()
pygame.display.set_caption('Wall-e') pygame.display.set_caption('Wall-e')
@ -12,12 +17,19 @@ tileImage = pygame.image.load('tile1.png')
surfaceSize = width, height = (512, 512) surfaceSize = width, height = (512, 512)
surface = pygame.Surface(surfaceSize) surface = pygame.Surface(surfaceSize)
for x in range(0, 512, 16): for x in range(0, 512, 16):
for y in range(0, 512, 16): for y in range(0, 512, 16):
surface.blit(tileImage, (x, y)) surface.blit(tileImage, (x, y))
screen.blit(surface, (0,0)) screen.blit(surface, (0,0))
smieciara1 = trashmaster()
smieciara_list = pygame.sprite.Group()
smieciara_list.add(smieciara1)
smieciara_list.draw(screen)
pygame.display.update() pygame.display.update()
running = True running = True
@ -28,5 +40,3 @@ while running:
pygame.quit() pygame.quit()
# test push

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB