def __init__(self, x, y, speed, life, lifeRegenerationRate, team): self.x = x self.y = y self.speed = speed self.currentLife = life self.maxLife = life self.lifeRegenerationRate = lifeRegenerationRate self.moving = False self.moveDirection = 0 self.timeMoving = 0 self.team = team self.alive = True if self.team == 0: self.image = loadImage("art/peasant.png", (255,255,255)) else: self.image = loadImage("art/Egyptian_peasant.png", (255,255,255))
def __init__(self, x, y, team): Creature.__init__(self, x, y, SWORDSMAN_SPEED, SWORDSMAN_LIFE, SWORDSMAN_REGENERATION, team) self.attack = SWORDSMAN_ATTACK self.attackSpeed = SWORDSMAN_ATTACK_SPEED self.lastAttack = 0 if self.team == 0: self.image = loadImage("art/greek_swordsman.png", (255,255,255)) else: self.image = loadImage("art/egyptian_swordsman.png", (255,255,255))
def __init__(self, x, y, team): Creature.__init__(self, x, y, ARCHER_SPEED, ARCHER_LIFE, ARCHER_REGENERATION, team) self.attack = ARCHER_ATTACK self.attackSpeed = ARCHER_ATTACK_SPEED self.lastAttack = 0 if self.team == 0: self.image = loadImage("art/greek_archer.png", (255,255,255)) else: self.image = loadImage("art/egytian_archer.png", (255,255,255))
def __init__(self, x, y, team): Creature.__init__(self, x, y, WIZARD_SPEED, WIZARD_LIFE, WIZARD_REGENERATION, team) self.attack = WIZARD_ATTACK self.attackSpeed = WIZARD_ATTACK_SPEED self.lastAttack = 0 self.movement = 0 if self.team == 0: self.image = loadImage("art/wizard.png", (255,255,255)) else: self.image = loadImage("art/egyptian_magician.png", (255,255,255))
def __init__(self, x, y): self.x = x self.y = y self.explosionTime = 0 self.alive = True self.damageDealt = False self.images = [] self.images.append(loadImage("art/exp1.png", (119,157,118))) self.images.append(loadImage("art/exp2.png", (119,157,118)))
def __init__(self, x, y, terrain, life, lifeRegenerationRate, team, image_path): self.dimension = (2,2) self.x = x self.y = y self.maxLife = life self.currentLife = 1 self.alive = True self.lifeRegenerationRate = lifeRegenerationRate self.team = team self.removable = True for i in range(self.dimension[0]): for j in range(self.dimension[1]): if(terrain.walkable(self.x + i, self.y + j) == False): self.alive = False self.removable = False self.image = loadImage(image_path, (255,255,255)) if(self.alive): for i in range(self.dimension[0]): for j in range(self.dimension[1]): terrain.setThingOcupying(x+i, y+j, self)
def __init__(self, x, y, terrain, team): Building.__init__(self, x,y,terrain, BUILDING_LIFE, BUILDING_REGENERATION, team, "art/building1.png") if team == 0: self.image = loadImage('art/parathonon.png', (255,255,255)) else: self.image = loadImage('art/Pyramid.png', (255,255,255)) self.swordsman = [] self.numSwordsman = 0 self.maxNumberSwordsman = MAX_NUMBER_SWORDSMAN self.spawTime = SWORDSMAN_SPAWN_TIME self.timer = 0
def __init__(self, x, y, terrain, team): Building.__init__(self, x,y,terrain, BUILDING_LIFE, BUILDING_REGENERATION, team, "art/building1.png") if team == 0: self.image = loadImage('art/armory.png', (255,255,255)) else: self.image = loadImage('art/egyptian_armory.png', (255,255,255)) self.archers = [] self.numArchers = 0 self.maxNumberArchers = MAX_NUMBER_ARCHERS self.spawTime = ARCHER_SPAWN_TIME self.timer = 0
def __init__(self, x, y, terrain, team): Building.__init__(self, x,y,terrain, BUILDING_LIFE, BUILDING_REGENERATION, team, "art/building1.png") if team == 0: self.image = loadImage('art/greek_temple.png', (255,255,255)) else: self.image = loadImage('art/egyptian_temple.png', (255,255,255)) self.wizards = [] self.numWizards = 0 self.maxNumberWizards = MAX_NUMBER_WIZARDS self.spawTime = WIZARD_SPAWN_TIME self.timer = 0
def __init__(self, x, y, terrain, team): Building.__init__(self, x,y,terrain, BUILDING_LIFE, BUILDING_REGENERATION, team, "art/building1.png") if team == 0: self.image = loadImage('art/Greek_building.png', (255,255,255)) else: self.image = loadImage('art/egyptian_house.png', (255,255,255)) self.peasants = [] self.numPeasants = 0 self.maxNumPeasants = MAX_NUMBER_PEASANTS self.spawTime = PEASANT_SPAW_TIME self.timer = 0
def __init__(self, x, y): Creature.__init__(self, x, y, KRAKEN_SPEED, KRAKEN_LIFE, KRAKEN_REGENERATION, 2) self.attack = KRAKEN_ATTACK self.attackSpeed = KRAKEN_ATTACK_SPEED self.lastAttack = 0 self.image = loadImage("art/kraken.png", (255,255,255))
def __init__(self, x, y, type): self.type = type self.x = x self.y = y self.thingOcupying = None if(self.type == 0): self.image = loadImage("art/terrain1.png") elif(self.type == 1): self.image = loadImage("art/terrain1.png") elif(self.type == 2): #self.image = [] #self.image.append(loadImage("art/water3.png")) #self.image.append(loadImage("art/water1.png")) #self.image.append(loadImage("art/water2.png")) #self.randomFactor = random.randint(0, 1000) self.image = loadImage("art/terrain2.png") self.thingOcupying = WATER elif(self.type == 3): self.image = loadImage("art/terrain3.png") self.thingOcupying = ROCK
def __init__(self, x, y, damageValue, target): self.x = x self.y = y self.vx = 0 self.vy = 0 self.target = target self.speed = LIGHTNING_SPEED self.damage = damageValue self.alive = True self.image = loadImage("art/Egyptian_bolt.png", (255, 255, 255))