Merge pull request 'agent_sprite_1' (#1) from agent_sprite_1 into master
Reviewed-on: s462072/WALL-E#1
This commit is contained in:
commit
374a413b49
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
__pycache__
|
15
agent.py
Normal file
15
agent.py
Normal 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
19
main.py
@ -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()
|
||||
|
BIN
resources/textures/trashmaster_blu.png
Normal file
BIN
resources/textures/trashmaster_blu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
BIN
resources/textures/trashmaster_orange.png
Normal file
BIN
resources/textures/trashmaster_orange.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
Loading…
Reference in New Issue
Block a user