agent_sprite_1 #1

Merged
s462072 merged 2 commits from agent_sprite_1 into master 2022-03-09 22:51:51 +01:00
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()

25
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:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
smieciara1 = trashmaster()
smieciara_list = pygame.sprite.Group()
smieciara_list.add(smieciara1)
smieciara_list.draw(screen)
# end
pygame.quit()
pygame.display.update()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB