def __init__(self, position): pygame.sprite.Sprite.__init__(self, self.groups) self.explosion_images = load_sliced_sprites(50, 50, os.path.join('Resources','Images','Animations','explosiontileset.png')) for image in self.explosion_images: image.set_colorkey(image.get_at((0, 0))) # issues here suppost to make transparent self.frame = 0 # starting image self.image = self.explosion_images[self.frame] # use frame to get correct image self.rect = self.image.get_rect() self.NEW_IMAGE = 3 # time between images self.new_image = self.NEW_IMAGE # so we can reset the timer self.rect.center = position # center = position that was recieved when we called this
def enemy_stats(enemy_type, which_stats): #stores all of the info for the enemies!@!$!@$#^& stats = [] images = [] base_life = 0 # we need to send SOMETHING to the wave info in HUDs if enemy_type == 'basic': images.append(pygame.image.load(os.path.join('Resources','Images','Sprites','Enemies','basic.png')).convert()) base_life = 4 speed = 2.5 reward = 10 wave_ammount = 10 # ammount of enemies per wave if enemy_type == 'fast': images.append(pygame.image.load(os.path.join('Resources','Images','Sprites','Enemies','fast.png')).convert()) base_life = 3 speed = 3.5 reward = 10 wave_ammount = 10 if enemy_type == 'slow': images.append(pygame.image.load(os.path.join('Resources','Images','Sprites','Enemies','slow.png')).convert()) base_life = 8 speed = 1.3 reward = 10 wave_ammount = 10 if enemy_type == 'boss': images.append(pygame.image.load(os.path.join('Resources','Images','Sprites','Enemies','boss.png')).convert()) base_life = 85 speed = 1.0 reward = 100 wave_ammount = 1 if enemy_type == 'zombie': images = load_sliced_sprites(30, 30, os.path.join('Resources','Images','Sprites','Enemies','zombie tile set.png')) base_life = 200 speed = 0.7 reward = 200 wave_ammount = 1 if which_stats == 'all_stats': stats.extend([images, base_life, speed, reward]) return stats if which_stats == 'life': return base_life if which_stats == 'wave_stats': return wave_ammount
def __init__(self, position): pygame.sprite.Sprite.__init__(self, self.groups) self.explosion_images = load_sliced_sprites( 50, 50, os.path.join('Resources', 'Images', 'Animations', 'explosiontileset.png')) for image in self.explosion_images: image.set_colorkey(image.get_at( (0, 0))) # issues here suppost to make transparent self.frame = 0 # starting image self.image = self.explosion_images[ self.frame] # use frame to get correct image self.rect = self.image.get_rect() self.NEW_IMAGE = 3 # time between images self.new_image = self.NEW_IMAGE # so we can reset the timer self.rect.center = position # center = position that was recieved when we called this
def enemy_stats(enemy_type): stats = {'base_life': 0} if enemy_type == 'basic': stats['image'] = pygame.image.load( os.path.join('Resources', 'Images', 'Sprites', 'Enemies', 'basic.png')).convert() stats['base_life'] = 4 stats['speed'] = 2.5 stats['reward'] = 10 stats['wave_ammount'] = 10 # ammount of enemies per wave if enemy_type == 'fast': stats['image'] = pygame.image.load( os.path.join('Resources', 'Images', 'Sprites', 'Enemies', 'fast.png')).convert() stats['base_life'] = 3 stats['speed'] = 3.5 stats['reward'] = 10 stats['wave_ammount'] = 10 if enemy_type == 'slow': stats['image'] = pygame.image.load( os.path.join('Resources', 'Images', 'Sprites', 'Enemies', 'slow.png')).convert() stats['base_life'] = 8 stats['speed'] = 1.3 stats['reward'] = 10 stats['wave_ammount'] = 10 if enemy_type == 'boss': stats['image'] = pygame.image.load( os.path.join('Resources', 'Images', 'Sprites', 'Enemies', 'boss.png')).convert() stats['base_life'] = 100 stats['speed'] = 1.0 stats['reward'] = 100 stats['wave_ammount'] = 1 if enemy_type == 'zombie': stats['image'] = load_sliced_sprites(30, 30, os.path.join('Resources', 'Images', 'Sprites', 'Enemies', 'zombie tile set.png')) stats['base_life'] = 200 stats['speed'] = 0.7 stats['reward'] = 200 stats['wave_ammount'] = 1 return stats