Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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")
Пример #4
0
 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)
Пример #5
0
 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")
Пример #6
0
 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")
Пример #7
0
 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")
Пример #8
0
 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")
Пример #9
0
 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")
Пример #10
0
 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")
Пример #11
0
 def born(self):
     Agent.born(self)
     self.requestActions("projectile")
     self.requestActions("game")
     self.sendBroadcastMessage(Message("new_item", (self.type, self.id)), "network")
Пример #12
0
 def born(self):
     Agent.born(self)
     self.requestActions("projectile")
     self.requestActions("game")
     self.sendBroadcastMessage(Message("new_item", (self.type, self.id)),
                               "network")
Пример #13
0
 def __init__(self, gateway, **args):
     Agent.__init__(self, "game", gateway, **args)
     self.characters = []
     self.current = None 
     self.registerEvent("gateway")
Пример #14
0
 def __init__(self, gateway, **args):
     Agent.__init__(self, "game", gateway, **args)
     self.characters = []
     self.current = None
     self.registerEvent("gateway")
Пример #15
0
 def born(self):
     Agent.born(self)
     self.requestActions("world")
     self.requestActions("network")
Пример #16
0
 def __init__(self, gateway, **args):
     Agent.__init__(self, "log", gateway, **args)
     self.registerEvent("gateway")
     log.on_new_message = self.onNewMessage
Пример #17
0
 def __init__(self, gateway, **args):
     Agent.__init__(self, "log", gateway, **args)
     self.registerEvent("gateway")
     log.on_new_message = self.onNewMessage
Пример #18
0
 def born(self):
     Agent.born(self)
     self.requestActions("world")
     self.requestActions("network")