예제 #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")