def generateMonsters(self, start, blockNumber, monster): enemy1 = Monster() enemy2 = Monster() enemy1.level = self enemy1.rect.x = self.level[len(self.level)-3].dimensions[2] + 100 + self.world_shift enemy1.rect.y = self.level[len(self.level)-3].dimensions[3]-enemy1.rect.height enemy1.maxHealth += 10*blockNumber enemy1.currentHealth = enemy1.maxHealth enemy1.attackDamage += blockNumber enemy1.monsterLevel = blockNumber enemy1.experience = (blockNumber+1)*20 self.enemy_list.add(enemy1) monster.append(enemy1) enemy2.level = self enemy2.rect.x = self.level[len(self.level)-2].dimensions[2] + 100 + self.world_shift enemy2.rect.y = self.level[len(self.level)-2].dimensions[3]-enemy1.rect.height enemy2.maxHealth += 10*blockNumber enemy2.currentHealth = enemy1.maxHealth enemy2.attackDamage += blockNumber enemy2.moveDirection = "Left" enemy2.monsterLevel = blockNumber enemy2.experience = (blockNumber+1)*20 monster.append(enemy2) self.enemy_list.add(enemy2)
def respawnMonsters(self, monster): if len(self.respawnQueue) > 0: blockDimensions = self.respawnQueue[0][0] monsterLevel = self.respawnQueue[0][1] enemy = Monster() enemy.rect.x = blockDimensions[2] + 100 + self.world_shift enemy.rect.y = blockDimensions[3] - enemy.rect.height enemy.attackDamage += monsterLevel enemy.monsterLevel = monsterLevel enemy.experience = (monsterLevel + 1) * 10 enemy.maxHealth += 10*monsterLevel enemy.currentHealth = enemy.maxHealth enemy.level = self monster.append(enemy) self.enemy_list.add(enemy) self.respawnQueue = self.respawnQueue[1:]