def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "mr_h.png", -1, "coordMr_h.txt", [ 3, 3, 3, 3], player, (0, 10, 6, 10, 6, 4, 6, 8), director) # Maybe another kind of weapon? self.setWeapon(WpnRifle()) self.hp = 200
def __init__(self, xlocation, ylocation, level, fps=1): # unique attributes parent class doesn't have self.enemy_ID = 2 # icecream ID self.image = PI.load("FPGraphics/burger/burgerFront.png") \ .convert_alpha() self.front_image = self.image self.bound_factor = 2 # attributes to be passed to parent for parent function use self.health = self.set_health(level) self.speed = self.set_speed(level) self.rect = self.image.get_rect() self.rect.x = xlocation self.rect.y = ylocation self.xboundl = xlocation - self.rect.width*self.bound_factor self.yboundt = ylocation - self.rect.width*self.bound_factor self.xboundr = xlocation + self.rect.width*self.bound_factor self.yboundb = ylocation + self.rect.width*self.bound_factor self.detect_distance = 250 self.IMAGES_RIGHT = [] self.IMAGES_LEFT = [] self.IMAGES_FRONT = [] self.IMAGES_BACK = [] self.load_images() Enemy.__init__(self, self.rect, self.IMAGES_RIGHT, self.IMAGES_LEFT, self.IMAGES_FRONT, self.IMAGES_BACK, self.health) self.drop_num = 3
def __init__(self, xlocation, ylocation, level, fps=1): # unique attributes parent class doesn't have self.enemy_ID = 2 # icecream ID self.image = PI.load("FPGraphics/burger/burgerFront.png") \ .convert_alpha() self.front_image = self.image self.bound_factor = 2 # attributes to be passed to parent for parent function use self.health = self.set_health(level) self.speed = self.set_speed(level) self.rect = self.image.get_rect() self.rect.x = xlocation self.rect.y = ylocation self.xboundl = xlocation - self.rect.width * self.bound_factor self.yboundt = ylocation - self.rect.width * self.bound_factor self.xboundr = xlocation + self.rect.width * self.bound_factor self.yboundb = ylocation + self.rect.width * self.bound_factor self.detect_distance = 250 self.IMAGES_RIGHT = [] self.IMAGES_LEFT = [] self.IMAGES_FRONT = [] self.IMAGES_BACK = [] self.load_images() Enemy.__init__(self, self.rect, self.IMAGES_RIGHT, self.IMAGES_LEFT, self.IMAGES_FRONT, self.IMAGES_BACK, self.health) self.drop_num = 3
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "nazist.png", -1, "coordNazist.txt", [3, 3, 3, 3], player, (0, 10, 6, 10, 6, 4, 6, 8), director) self.controller = RangeController(self, player, director) self.setWeapon(WpnRifle()) self.atk_delay_reset = 3.0 #Otherwise you don't have a chance self.hp = 50
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "mr_h.png", -1, "coordMr_h.txt", [3, 3, 3, 3], player, (0, 10, 6, 10, 6, 4, 6, 8), director) # Maybe another kind of weapon? self.setWeapon(WpnRifle()) self.hp = 200
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "FutureSoldier.png", -1, "coordFutureSoldier.txt", [3, 3, 3, 3], player, (0, 10, 6, 10, 6, 4, 6, 8), director) self.controller = RangeController(self, player, director) self.setWeapon(WpnLaser()) self.hp = 200 self.atk_delay_reset = 2.5
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "page.png", -1, "coordLarryPage.txt", [3, 3, 3, 3], player, (0, 10, 6, 10, 2, 4, 6, 11), director) self.setWeapon( WpnBlade("lightsaber.png", -1, Rect(128, 209, 42, 42), "sthswng1.wav", 0.2)) self.hp = 300
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "legionnaire.png", -1, "coordLegion.txt", [3, 3, 3, 3], player, (5, 25, 15, 25, 10, 25, 0, 30), director) self.setWeapon( WpnBlade("wpns2.png", -1, Rect(344, 342, 28, 28), "blade_swing.wav", 0.5)) self.alive = True self.hp = 30
def __init__(self, pos): Enemy.__init__(self, Constants.PlayerImage(), pos) self.circlespeed = 0.01 self.offsetspeed = 0.3 self.dir = 0, 1 self.speed = 3 self.bulletrate = 0.05 timer = Timer(self.bulletrate, self.shoot_bullet) self.timers.append(timer)
def __init__(self, x0, z0, modelo): # Invoca al constructor de la clase base Enemy.__init__(self, x0, z0, modelo) # Inicializa algunos atributos con valores diferentes self.ship.setScale(4, 1, 3) self.ia = False self.vida = VIDA self.puntos = PUNTOS self.velocidad = VELOCIDAD
def __init__(self, x): idle = SpriteSheet("art/en_melee_minion_atk.png").images_at( [(0,0,400,300)],colourkey=(0,255,0)) attack = SpriteSheet("art/en_melee_minion_atk.png").images_at( [(0,0,400,300), (400,0,400,300), (800,0,400,300), (1200,0,400,300)],colourkey=(0,255,0)) Enemy.__init__(self, x, idle, idle, attack) self.damage = 3 self.attack_time = 0 self.time_till_attack = 60 self.health = 200 self.total_health = 200
def __init__(self, x): idle = SpriteSheet("art/en_skeleton.png").images_at( [(0,0,300,400)],colourkey=(0,255,0)) attack = SpriteSheet("art/en_skeleton_atk.png").images_at( [(0,0,300,400), (300,0,300,400), (600,0,300,400), (900,0,300,400)],colourkey=(0,255,0)) Enemy.__init__(self, x, idle, idle, attack) self.attack_time = 0 self.time_till_attack = 48 self.health = 75 self.total_health = 75 self.has_frontline = True
def __init__(self, x): idle = SpriteSheet("art/en_zombie.png").images_at( [(0,0,300,400)],colourkey=(0,255,0)) attack = SpriteSheet("art/en_zombie_atk.png").images_at( [(0,0,300,400), (300,0,300,400)],colourkey=(0,255,0)) walk = SpriteSheet("art/en_zombie_walk.png").images_at( [(0,0,300,400), (300,0,300,400), (600,0,300,400)],colourkey=(0,255,0)) Enemy.__init__(self, x, idle, walk, attack) self.damage = 3 self.attack_time = 0 self.time_till_attack = 50 self.health = 60 self.total_health = 60
def __init__(self, xlocation, ylocation, fps=1): # unique attributes parent class doesn't have self.enemy_ID = 1 # icecream ID self.image = PI.load("FPGraphics/Food/IceCreamFront.png") \ .convert_alpha() self.front_image = self.image # attributes to be passed to parent for parent function use self.health = 1 self.speed = 1 * fps self.rect = self.image.get_rect() self.rect.x = xlocation self.rect.y = ylocation self.IMAGES_RIGHT = [] self.IMAGES_LEFT = [] self.IMAGES_FRONT = [] self.IMAGES_BACK = [] self.load_images() Enemy.__init__(self, self.rect, self.IMAGES_RIGHT, self.IMAGES_LEFT, self.IMAGES_FRONT, self.IMAGES_BACK, self.health)
def __init__(self, xlocation, ylocation, fps=1): # unique attributes parent class doesn't have self.enemy_ID = 1 # icecream ID self.image = PI.load("FPGraphics/Food/IceCreamFront.png").convert_alpha() self.front_image = self.image # attributes to be passed to parent for parent function use self.health = 1 self.speed = 1 * fps self.rect = self.image.get_rect() self.rect.x = xlocation self.rect.y = ylocation self.IMAGES_RIGHT = [] self.IMAGES_LEFT = [] self.IMAGES_FRONT = [] self.IMAGES_BACK = [] self.load_images() Enemy.__init__( self, self.rect, self.IMAGES_RIGHT, self.IMAGES_LEFT, self.IMAGES_FRONT, self.IMAGES_BACK, self.health )
def __init__(self, mainGameClass): Enemy.__init__(self, mainGameClass) self.updateCount = 0 self.currentImage = 0 self.subtype = random.randint(1, 10) self.image = FlyingEnemy.images[self.currentImage] self.rect = self.image.get_rect() self.height -= self.rect.height / 2 + 10 + 10 * self.subtype self.rect.center = (mainGameClass.getScreenWidth() + self.rect.width, self.height) collision = CollisionBox(2, 0, self.rect.w - 28, self.rect.h - 8, self.rect.center) self.collisionBoxes.add(collision) self.speed = self.thisGame.getGameSpeed() * 2
def __init__(self, xlocation, ylocation, fps=1): # unique attributes parent class doesn't have self.enemy_ID = 3 self.image = PI.load("FPGraphics/cupcake/cupcake.png") \ .convert_alpha() self.front_image = self.image # attributes to be passed to parent for parent function use self.health = 3 self.rect = self.image.get_rect() self.rect.x = xlocation self.rect.y = ylocation self.pdx = 0 self.xchange = random.randint(0, 3) self.pdy = 1 self.IMAGES_RIGHT = [] self.IMAGES_LEFT = [] self.IMAGES_FRONT = [] self.IMAGES_BACK = [] self.load_images() Enemy.__init__(self, self.rect, self.IMAGES_RIGHT, self.IMAGES_LEFT, self.IMAGES_FRONT, self.IMAGES_BACK, self.health) self.drop_num = 3
def __init__(self, mainGameClass): Enemy.__init__(self, mainGameClass) for array in self.images: for image in array: image.set_colorkey((255, 0, 255)) self.subtype = random.randint(0, len(StandingEnemy.images) - 1) self.image = random.choice(StandingEnemy.images[self.subtype]) self.rect = self.image.get_rect() self.height -= self.rect.height / 2 self.rect.center = (mainGameClass.getScreenWidth() + self.rect.width, self.height) collision = CollisionBox(9, 3, self.rect.w - 18, self.rect.h - 6, self.rect.center) self.collisionBoxes.add(collision) self.speed = self.thisGame.getGameSpeed()
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "page.png", -1, "coordLarryPage.txt", [3, 3, 3, 3], player, director, (0, 10, 6, 10, 2, 4, 6, 11)) self.setWeapon(WpnBlade("lightsaber.png", -1, Rect(128, 209, 42, 42), "sthswng1.wav", 0.2)) self.hp = 150
def __init__(self, pos): Enemy.__init__(self, Constants.PlayerImage(), pos) self.vel = (0, 1.5) self.bulletrate = 1 self.bulletspeed = 3 self.timers.append(Timer(self.bulletrate, self.shoot_bullet))
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "legionnaire.png", -1, "coordLegion.txt", [3, 3, 3, 3], player, (5, 25, 15, 25, 10, 25, 0, 30), director) self.setWeapon(WpnBlade("wpns2.png", -1, Rect(344, 342, 28, 28), "blade_swing.wav", 0.5)) self.alive = True self.hp = 30
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "nazist.png", -1, "coordNazist.txt", [3, 3, 3, 3], player, director, (0, 10, 6, 10, 6, 4, 6, 8)) self.setWeapon(WpnRifle())
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "caesar.png", -1, "coordCaesar.txt", [3, 3, 3, 3], player, (0, 10, 6, 10, 2, 4, 6, 11), director) self.setWeapon(WpnBlade("wpns2.png", -1, Rect(344, 342, 28, 28), "blade_swing.wav", 0.5)) self.hp = 60
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "FutureSoldier.png", -1, "coordFutureSoldier.txt", [3, 3, 3, 3], player, director, (0, 10, 6, 10, 6, 4, 6, 8)) self.setWeapon(WpnLaser()) self.hp = 50
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "newton.png", -1, "coordNewton.txt", [3, 3, 3, 3], player, director=director) self.controller = RangeController(self, player, director) self.setWeapon(WpnGrenade()) self.atk_delay_reset = 2.0 self.hp = 150
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "wolves.png", -1, "coordWolves.txt", [3, 3, 3, 3], player, director) self.equippedWpn = WpnBite()
def __init__(self, x, y, player, director): Enemy.__init__(self, x, y, "newton.png", -1, "coordNewton.txt", [3, 3, 3, 3], player, director) self.setWeapon(WpnGrenade())
def __init__(self, name='Ogre', health=1800, mp=200, stats={'Attack':100,'Defense':35,'Magic Attack':15,'Magic Defense':8,'Skill':20}, level=20,xp=1000, is_alive=True, affinity={'Physical':1, 'Fire': 1, 'Ice': 0.5, 'Electricity': 1.25, 'Wind': 0.5, 'Light': 1.25, "Dark": 0.75}, status={'Normal':True}, stat_multiplier={'Attack':1,'Defense':1,'Magic Attack':1,'Magic Defense':1,'Skill':1}): Enemy.__init__(self, name, health, mp, stats, level, xp, is_alive, affinity, status, stat_multiplier )