Exemple #1
0
 def __init__(self, size, position, maxRotVel, maxRotAcc, a):
    
     NPC.__init__(self, size, position, maxRotVel, maxRotAcc, a)
     
     self.name = 'Prey'
     self.alive = True
     self.deathAnim = []
     for i in range(6):
         self.deathAnim.append( pygame.image.load('data/Prey 0%d.png' % (i+1)))
     self.imageIndex = 0
     self.image = self.deathAnim[self.imageIndex]
     self.radius = self.image.get_rect().width/2
     self.lifeSpan = 30 * len(self.deathAnim)
 def __init__(self, size, position, maxRotVel, maxRotAcc, a):
     NPC.__init__(self, size, position, maxRotVel, maxRotAcc, a)
     self.origImage = pygame.image.load('data/Predator.png')      
     self.dieImg = [pygame.image.load('data/Predator 01.png'),     
     pygame.image.load('data/Predator 02.png'),
     pygame.image.load('data/Predator 03.png'),
     pygame.image.load('data/Predator 04.png'),
     pygame.image.load('data/Predator 05.png'),
     pygame.image.load('data/Predator 06.png'),
     pygame.image.load('data/Predator 07.png'),     
     pygame.image.load('data/Predator 08.png'),
     pygame.image.load('data/Predator 09.png')]
     self.dieLvl = 0
     self.image = self.origImage 
     self.name = 'Predator'
     self.lifeSpan = 10000
     self.birth = time.time()
     self.rotate = 0.0
     self.radius = self.image.get_rect().width/2
     self.chaseDist = 200