Merge pull request 'agent_sprite_1' (#1) from agent_sprite_1 into master

Reviewed-on: s462072/WALL-E#1
This commit is contained in:
Bartosz Wieczorek 2022-03-09 22:51:51 +01:00
commit 374a413b49
5 changed files with 33 additions and 8 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()

19
main.py
View File

@ -1,5 +1,8 @@
import pygame
from map import preparedMap
from agent import trashmaster
pygame.init()
#config
SCREEN_SIZE = [512, 512]
@ -22,12 +25,18 @@ if __name__ == '__main__':
# update okna
pygame.display.update()
# event loop
running = True
while running:
smieciara1 = trashmaster()
smieciara_list = pygame.sprite.Group()
smieciara_list.add(smieciara1)
smieciara_list.draw(screen)
pygame.display.update()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# end
pygame.quit()
pygame.quit()

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB