1
Fork 0

updated texture code and lives

This commit is contained in:
Jake Howard 2015-05-19 12:17:27 +01:00
parent 33df9d2ecf
commit 840e1d0b78

View file

@ -8,11 +8,14 @@ class Target(pygame.sprite.Sprite):
super().__init__() super().__init__()
self.width = width self.width = width
self.height = height self.height = height
self.image = pygame.transform.scale(textures.get_target_texture(), (self.width, self.height)) self.textures = textures
self.default_texture = textures.get_target_texture()
self.image = pygame.transform.scale(self.default_texture[0], (self.width, self.height))
self.rect = self.image.get_rect() self.rect = self.image.get_rect()
self.speed = 5 self.speed = 5
self.rect.x, self.rect.y = (x+(self.width/2)),(y+(self.width/2)) # centres co-ordinates self.rect.x, self.rect.y = (x+(self.width/2)),(y+(self.width/2)) # centres co-ordinates
self.type = "NORMAL" self.type = "NORMAL"
self.lives = 1
def move(self): def move(self):
self.rect.x += self.speed self.rect.x += self.speed
@ -27,7 +30,6 @@ class Target(pygame.sprite.Sprite):
else: else:
self.rect.x, self.rect.y = x, y self.rect.x, self.rect.y = x, y
def generate_targets(player, window_size, Levels): def generate_targets(player, window_size, Levels):
sprite_list = [] sprite_list = []
group = pygame.sprite.Group() group = pygame.sprite.Group()