Merge pull request 'refactor_agent2' (#3) from refactor_agent2 into master

Reviewed-on: #3
This commit is contained in:
Bartosz Wieczorek 2022-03-11 13:02:04 +01:00
commit 18b92c4e3d
2 changed files with 9 additions and 9 deletions

View File

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

View File

@ -34,7 +34,7 @@ def main():
game = WalleGame() game = WalleGame()
game.update_window() game.update_window()
smieciara_object = trashmaster() smieciara_object = trashmaster(16,16,"resources/textures/trashmaster_blu.png",16)
game.draw_trashmaster(smieciara_object) game.draw_trashmaster(smieciara_object)
game.update_window() game.update_window()