refactor_agent2

This commit is contained in:
Kacper Kalinowski 2022-03-11 13:00:11 +01:00
parent 049cc5126f
commit 039ea1d188
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.image = pygame.image.load(img)
self.image = pygame.transform.scale(self.image, (self.x,self.y))
self.rect = self.image.get_rect() self.rect = self.image.get_rect()
garbagetruck_list = pygame.sprite.Group()

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()