From b6566b20ecd8792d96f4f039d84f4d35271ac630 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 14 May 2015 13:21:54 +0100 Subject: [PATCH] added option to reset image --- player.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/player.py b/player.py index 9f46cfb..93783de 100644 --- a/player.py +++ b/player.py @@ -7,7 +7,8 @@ class Shooter(pygame.sprite.Sprite): self.width = width self.height = height self.colour = colour - self.image = pygame.transform.scale(texture.get_texture("PLAYER"), (self.width, self.height)) + self.texture = texture + self.image = pygame.transform.scale(self.texture.get_texture("PLAYER"), (self.width, self.height)) self.rect = self.image.get_rect() self.speed = 3 self.window_rect = window.get_rect() @@ -33,4 +34,8 @@ class Shooter(pygame.sprite.Sprite): x,y = self.rect.x, self.rect.y self.image.fill(colour) self.rect = self.image.get_rect() - self.set_position(x,y) \ No newline at end of file + self.set_position(x,y) + + def reset_image(self): + self.image = pygame.transform.scale(self.texture.get_texture("PLAYER"), (self.width, self.height)) + self.rect = self.image.get_rect() \ No newline at end of file