def __init__(self, personality, x=0, y=0): Individuo.__init__(self) Human.__init__(self, personality, x, y) self._dinero_inicial,self._lucidez, self._ansiedad, self._suerte, \ self._sociabilidad, self._stamina, self._deshonestidad = \ self.valores(personality) self.ansiedad_aumentada = False self.personalidad = personality self._dinero = 200 * self._dinero_inicial self.ancho = 36 self.alto = 36 self.destino = (x, y) self.camino = deque() self.accion = "" self.transportandose = False self.add_decoration("gui/assets/decoration/transparent.png") self._tiempo_accion = 0 self.ya_realizado = False self.hablado = False self.fuera = False self.mafia = False self.contar = False self.estadia = 0 self.razon_retirada = ""
def __init__(self, tipo, x=0, y=0, hora_inicio=datetime(1, 1, 1)): Individuo.__init__(self) Human.__init__(self, choice(list(Cliente.dicc_personalidades)), x, y) self.tipo = tipo self._tiempo_trabajo = timedelta(minutes=0) self.ancho = 36 self.alto = 36 self._tiempo_descanso = timedelta(hours=int(normalvariate(14, 5))) self._tiempo_diario_trabajado = timedelta(minutes=0) self._tiempo_diario_restante = timedelta(days=1) self.add_decoration("gui/assets/decoration/red.png") self.trabajo = 0 #hasta qué hora es el trabajo self.descanso = 0 #hasta qué hora es el descanso self.descanso = hora_inicio + timedelta(hours=randint(1, 18)) self.calcular_tiempo_trabajo(self.descanso) self.mafia = False
from gui.entities import Entity, Human import gui import os _PATH = os.path.dirname(os.path.abspath(__file__)) gui.init() client = Human("ludopata") client.add_decoration("gui/assets/decoracion/bullet.png") client.angle = 0 client.y = 0 client.x = 0 ticks = 0 def tick(): client.x += 1 client.y += 1 client.angle = 1 gui.set_size(773, 485) gui.add_entity(client) gui.run(tick, 30)
import time from gui.entities import Human, Zombie, Bullet, Building, GunShopLong, GunShopShort import gui import random import math gui.init() human = Human(Human.COWARD, Human.NO_WEAPON, cord_x=100, cord_y=100) human.add_decoration("gui/assets/bullet.png") zombie = Zombie() human.angle = 0 ticks = 0 def tick(): human.cord_x += 1 human.cord_y += 1 human.angle += 1 zombies = [] for i in range(20): zombie = Zombie(cord_x=random.randint(0, 800), cord_y=random.randint(0, 800)) gui.add_entity(zombie) zombies.append(zombie) gui.add_entity(human) gui.add_entity(zombie) gui.add_entity(GunShopLong(100, 200)) gui.add_entity(GunShopShort(300, 300))
from gui.entities import Entity, Human import gui import os _PATH = os.path.dirname(os.path.abspath(__file__)) gui.init() client = Human("millonario") client.add_decoration("gui/assets/decoracion/bullet.png") client.angle = 0 client.y = 0 client.x = 0 ticks = 0 def tick(): client.x += 1 client.y += 1 client.angle += 1 gui.set_size(773, 485) gui.add_entity(client) gui.run(tick, 50)