refactor_agent2 #3

Merged
s462072 merged 1 commits from refactor_agent2 into master 2022-03-11 13:02:04 +01:00
2 changed files with 9 additions and 9 deletions

View File

@ -1,14 +1,14 @@
import pygame.image
class trashmaster(pygame.sprite.Sprite):
def __init__(self):
def __init__(self,x,y,img,vel):
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.x=x
self.y=y
self.img = img
self.velocity = vel
self.image = pygame.image.load(img)
self.image = pygame.transform.scale(self.image, (self.x,self.y))
self.rect = self.image.get_rect()
garbagetruck_list = pygame.sprite.Group()

View File

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