def __init__(self, gateway, **args): Agent.__init__(self, "world", gateway, **args) self.buildings = None self.height = 350 self.width = 640 self.registerEvent("gateway") self.generate()
def born(self): Agent.born(self) self.requestRole("command_manager") self.requestActions("weapon") self.requestActions("game") self.requestActions("network") self.sendBroadcast(Message("new_item", (self.type, self.id)), "network")
def live(self): Agent.live(self) if self.active: dt = time.time() - self.time x = self.start_pos[0] +self.speed[0] * dt y = self.start_pos[1] +self.speed[1] * dt +9.8*dt*dt*self.mass self.move (x, y)
def __init__(self, gateway, **args): Agent.__init__(self, "weapon", gateway, **args) self.angle = 45 self.strength = 50 self.last_values = {} self.currentTeam = None self.nextTeam = None self.registerEvent("gateway")
def __init__(self, gateway, x, team, **args): Agent.__init__(self, "character", gateway, **args) self.x = x self.y = 0 self.width = 28 self.height = 29 self.team = team self.next = False self.current = False self.registerEvent("gateway")
def born(self): Agent.born(self) self.requestActions("game") self.requestActions("network") self.sendBroadcast( Message("character_search_place", (self.x, self.width, self.height)), "world") self.sendBroadcast(Message("new_character", (self, )), "game") self.sendBroadcast(Message("new_item", (self.type, self.id)), "network")
def __init__(self, gateway, **args): Agent.__init__(self, "projectile", gateway, **args) self.x, self.y = 0, 0 self.start_pos = None self.active = False self.active_character = None self.character_pos = {} self.start_pos = None self.time = None self.speed = None self.weapon_angle = None self.weapon_strength = None self.mass = 10 self.registerEvent("gateway") self.registerEvent("weapon")
def born(self): Agent.born(self) self.requestActions("projectile") self.requestActions("game") self.sendBroadcastMessage(Message("new_item", (self.type, self.id)), "network")
def __init__(self, gateway, **args): Agent.__init__(self, "game", gateway, **args) self.characters = [] self.current = None self.registerEvent("gateway")
def born(self): Agent.born(self) self.requestActions("world") self.requestActions("network")
def __init__(self, gateway, **args): Agent.__init__(self, "log", gateway, **args) self.registerEvent("gateway") log.on_new_message = self.onNewMessage