def test_check_turn(self):
        rc = RuleChecker()
        empty_board = Board()
        player = Avatar("white")
        tile = HandTile([('s1', 'e2'), ('s2', 'w1'), ('e1', 'n2'),
                         ('n1', 'w2')])
        tile_2 = HandTile([('n1', 's2'), ('n2', 'e2'), ('e1', 'w2'),
                           ('s1', 'w1')])
        suicide_tile = HandTile([('n1', 'w1'), ('n2', 'e1'), ('s2', 'e2'),
                                 ('s1', 'w2')])

        empty_board.first_turn(player, tile, "a1", "n2")
        self.assertAlmostEqual(player.current_port, "e1")
        self.assertAlmostEqual(player.current_tile, "a1")

        player.tiles = [tile_2, suicide_tile]

        # Tile has to be at the correct coordinate
        self.assertAlmostEqual(
            rc.check_turn(empty_board, tile_2, "a1", player)["legal"], False)
        self.assertAlmostEqual(
            rc.check_turn(empty_board, tile_2, "a2", player)["legal"], False)
        self.assertAlmostEqual(
            rc.check_turn(empty_board, tile_2, "b1", player)["legal"], True)

        # Tile cannot cause a suicide if there are other options
        self.assertAlmostEqual(
            rc.check_turn(empty_board, suicide_tile, "b1", player)["legal"],
            False)

        player.tiles = [suicide_tile]

        self.assertAlmostEqual(
            rc.check_turn(empty_board, suicide_tile, "b1", player)["legal"],
            True)
Exemplo n.º 2
0
def run_game():
    #Initialize game and create a screen object
    pygame.init()
    screen = pygame.display.set_mode((1200, 800))
    pygame.display.set_caption("Blue Sky")

    bg_color = (0, 0, 255)

    #Make an Avatar
    avatar = Avatar(screen)


    #Start the main loop for the game.
    while True:

        #Watch for keyboard and mouse events.
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                sys.exit()
        

        #Redraw the screen during each pass through the loop
        screen.fill(bg_color)
        avatar.blitme()
        #make the most recently drawn screen visible
        pygame.display.flip()
Exemplo n.º 3
0
    def __init__(self):
        self.avatar = Avatar()
        # 真实图片shape (height, width, depth)
        self.img_shape = self.avatar.img_shape
        # 一个batch的图片向量shape (batch, height, width, depth)
        self.batch_shape = self.avatar.batch_shape
        # 一个batch包含图片数量
        self.batch_size = self.avatar.batch_size
        # batch数量
        self.chunk_size = self.avatar.chunk_size

        # 噪音图片size
        self.noise_img_size = 100
        # 卷积转置输出通道数量
        self.gf_size = 64
        # 卷积输出通道数量
        self.df_size = 64
        # 训练循环次数
        self.epoch_size = 150
        # 学习率
        self.learning_rate = 0.0002
        # 优化指数衰减率
        self.beta1 = 0.5
        # 生成图片数量
        self.sample_size = 64
Exemplo n.º 4
0
    def test_take_turn(self):
        empty_board = Board()
        player = Avatar("white")
        hand_tile = HandTile([('s1', 'e2'), ('s2', 'w1'), ('e1', 'n2'),
                              ('n1', 'w2')])
        hand_tile_2 = HandTile([('n1', 'n2'), ('e1', 'w1'), ('e2', 'w2'),
                                ('s2', 's1')])

        self.assertAlmostEqual(player.current_tile, None)
        self.assertAlmostEqual(player.current_port, None)
        self.assertAlmostEqual(len(empty_board.tiles), 0)

        empty_board.first_turn(player, hand_tile, "a1", "n2")

        self.assertAlmostEqual(player.current_tile, "a1")
        self.assertAlmostEqual(player.current_port, "e1")
        self.assertAlmostEqual(len(empty_board.tiles), 1)

        try:
            empty_board.take_turn(hand_tile, "a2", player)
        except:
            print("Player has broken the rules")

        empty_board.take_turn(hand_tile_2, "b1", player)

        self.assertAlmostEqual(player.current_tile, "b1")
        self.assertAlmostEqual(player.current_port, "e1")
        self.assertAlmostEqual(len(empty_board.tiles), 2)
Exemplo n.º 5
0
 def get_avatar(self, id: int):
     """Returns student by id"""
     self.cur.execute(f"SELECT * FROM {self.table_name} WHERE id={id}")
     result = self.cur.fetchone()
     if result:
         return Avatar(**result)
     else:
         return ''
Exemplo n.º 6
0
 def get_avatars(self):
     """Returns student by id"""
     self.cur.execute(f"SELECT * FROM {self.table_name}")
     result = self.cur.fetchall()
     if result:
         return [Avatar(*tuple) for tuple in result]
     else:
         return None
Exemplo n.º 7
0
    def __init__(self, levelNum, sound=True):
        global soundtrack
        events.AddListener(self)
        self.done = False
        self.deathDelay = 0
        self.levelNum = levelNum
        strLevelNum = '%02d' % levelNum
        triggers = data.levelTriggers['leveltriggers' + strLevelNum]
        if not levelNum % 2:
            # even levels are repeats of previous images
            strLevelNum = '%02d' % (levelNum - 1)
        self.walkMask = data.levelMasks[strLevelNum]
        filePath = os.path.join(data.data_dir, 'levelbg%s-?.png' % strLevelNum)
        self.sound = sound

        bgPngs = glob.glob(filePath)
        bgPngs.sort()
        self.bgImages = [data.pngs[png] for png in bgPngs]

        self.avatar = Avatar()
        self.avatar.strings = player.strings[:]
        self.visualEffects = visualeffects.EffectManager()

        self.miscSprites = []
        healthFont = font.load('Oh Crud BB', 28)
        #self.healthText = font.Text(healthFont, x=10, y=25, text='Health:')
        self.healthBar = HeartMeter()
        self.energyBar = EnergyMeter((240, 5))

        self.fpsText = font.Text(healthFont, x=650, y=25)

        self.triggerZones = []
        for rect, clsName in triggers.items():
            cls = globals().get(clsName)
            if not cls:
                if len(rect) == 4:
                    print "ERROR: couldn't find", clsName
                continue
            zone = cls(rect, self)
            self.triggerZones.append(zone)
            if hasattr(zone, 'sprite'):
                self.miscSprites.append(zone.sprite)
            if DEBUG and hasattr(zone, 'debugSprite'):
                self.miscSprites.append(zone.debugSprite)

        self.enemySprites = {}

        self.startLoc = [
            key for key, val in triggers.items() if val == 'start location'
        ][0]

        if levelNum == 1 and self.sound:
            soundtrack = \
                queueSoundtrack('8bp077-01-nullsleep-her_lazer_light_eyes.mp3')
            soundtrack.play()
Exemplo n.º 8
0
def run(host, port, directory):
    logging.basicConfig(level=logging.DEBUG)

    with open('{}/options.json'.format(directory)) as option_file:
        options = json.load(option_file)
    from avatar import Avatar
    global worker_avatar
    worker_avatar = Avatar(**options)

    app.config['DEBUG'] = False
    app.run(host, port)
Exemplo n.º 9
0
def construct_avatar(avatar_dict):
    '''
	:param avatar_dict:	dict containing avatar obj info
	:return: constructed avatar obj
	'''
    avatar = Avatar(avatar_dict['color'], None)
    if not avatar_dict['position'] == None:
        pos = avatar_dict['position'][0]
        port = avatar_dict['position'][1]
        avatar.position = ((pos[0], pos[1]), port)

    return avatar
Exemplo n.º 10
0
def generate_avatar(unit_type: str, stack_count, cell: Cell = None):
    with open('pdata/wcAnimations.json', 'r') as file:
        sheet_data = json.load(file)
        sprite = AnimatedSprite(
            os.path.join('assets', 'unit', unit_type) + '.png',
            **sheet_data[unit_type])

    with open('pdata/wcUnits.json', 'r') as file:
        unit_data = json.load(file)
        avatar = Avatar(sprite, stack_count, cell, **unit_data[unit_type])

    return avatar
Exemplo n.º 11
0
def get_player_avatar_url(request, userid):
    """
    Returns a user's avatar URL, and create/retreive it from gravatar if none yet
    Returns 404 if the user is not found.
    """
    try:
        user = User.objects.get(id=userid)

        avatar = Avatar(user)
        if not avatar.in_cache():
            avatar = GravatarAvatar(user)
            avatar.update()

        return HttpResponse(avatar.get_url(), mimetype="text/plain")
    except User.DoesNotExist:
        return HttpResponseNotFound()
Exemplo n.º 12
0
    def test_check_player_dead(self):
        rule_checker = RuleChecker()
        board = Board()
        player = Avatar('green')
        tile_1 = HandTile([('n1', 's2'), ('n2', 'e2'), ('e1', 'w2'),
                           ('s1', 'w1')])
        tile_2 = HandTile([('n1', 'e2'), ('n2', 'w2'), ('e1', 's1'),
                           ('s2', 'w1')])

        board.first_turn(player, tile_1, 'a1', 'n1')
        self.assertAlmostEqual(player.current_port, 's2')
        self.assertAlmostEqual(player.current_tile, 'a1')

        self.assertAlmostEqual(
            rule_checker.check_player_dead(board, tile_2, "a2", player), True)
        self.assertAlmostEqual(
            rule_checker.check_player_dead(board, tile_1, "a2", player), False)
Exemplo n.º 13
0
    def __init__(self, list_of_players):
        '''
			@param: list_of_players: a list of players
			@return: none
		'''
        self.lastgame_round_players = list_of_players
        self.players = list_of_players
        self.rule_checker = Rule()
        self.board = Board([], [])
        self.loser = []
        self.log = []
        if len(list_of_players) > 5 or len(list_of_players) < 3:
            raise Exception("Incorrect number of players")
        colors = ["white", "black", "red", "green", "blue"]
        self.avatar_player = {}
        for i in range(len(list_of_players)):
            self.avatar_player[list_of_players[i]] = Avatar(colors[i], None)
Exemplo n.º 14
0
    def player_first_turn(self, player_color, tile_index, rotation,
                          board_coordinate, starting_port):
        new_player = Avatar(player_color)
        self.player_dictionary[player_color] = new_player

        first_turn_rule_check = self.initial_placement_check(
            tile_index, rotation, board_coordinate, starting_port)
        if first_turn_rule_check[LEGAL]:
            tile = self.deck.get_tile(tile_index)
            number_of_rotations = get_number_of_rotations(rotation)
            tile.rotate(number_of_rotations)
            self.board.first_turn(new_player, tile, board_coordinate,
                                  starting_port)
        else:
            self.dead_players.append(player_color)

        return first_turn_rule_check
Exemplo n.º 15
0
def construct_obj(res):
    '''

    :param res: response received from client
    :return: constructed tile, and avatar object received from client
    '''
    tile_dict = res[0]
    avatar_dict = res[1]
    tile = Tile(tile_dict['idx'], None)
    if not tile_dict['position'] == None:
        tile.position = (tile_dict['position'][0], tile_dict['position'][1])
    tile.list_of_path = tile_dict['list_of_path']
    avatar = Avatar(avatar_dict['color'], None)
    if not avatar_dict['position'] == None:
        pos = avatar_dict['position'][0]
        port = avatar_dict['position'][1]
        avatar.position = ((pos[0], pos[1]), port)
    return tile, avatar
Exemplo n.º 16
0
 def __init__(self):
     self.avatar = Avatar()
     # 真实图片shape (height, width, depth)
     self.img_shape = self.avatar.img_shape
     # 一个batch的图片向量shape (batch, height, width, depth)
     self.batch_shape = self.avatar.batch_shape
     # 一个batch包含图片数量
     self.batch_size = self.avatar.batch_size
     # batch的总数量
     self.chunk_size = self.avatar.chunk_size
     # 迭代次数
     self.epoch_size = 256
     # 学习率
     self.learning_rate = 2e-4
     # 优化指数衰减率
     self.beta1 = 0.5
     # channal
     self.channal = 8
Exemplo n.º 17
0
async def prebattle_ws_handler(request):
    session = await get_session(request)
    account_id = session['account_id']
    name = session['name']
    vehicle = session['vehicle']

    ws = web.WebSocketResponse()

    avatar = Avatar(account_id, name)
    avatar.set_vehicle(vehicle)
    BATTLE_QUEUE.append(avatar),
    avatar.connect(ws)

    await ws.prepare(request)

    roster = get_rosters(BATTLE_QUEUE)
    while roster:
        arena = Arena(teams=[roster[::2], roster[1::2]])
        ARENAS[arena.id] = arena

        for a in roster:
            a.send_message({'redirect': '/arena/{}'.format(arena.id)})
            a.disconnect()

        roster = get_rosters(BATTLE_QUEUE)

    for avatar in BATTLE_QUEUE:
        avatar.send_message(
            {'message': 'People awaiting: {}'.format(len(BATTLE_QUEUE))})

    async for msg in ws:
        if msg.tp == aiohttp.MsgType.text:
            if msg.data == 'close':
                await ws.close()
        elif msg.tp == aiohttp.MsgType.error:
            print('ws connection closed with exception %s' % ws.exception())

    if avatar in BATTLE_QUEUE:
        BATTLE_QUEUE.remove(avatar)

    return ws
Exemplo n.º 18
0
    def test_first_turn(self):
        empty_board = Board()
        player = Avatar("white")
        hand_tile = HandTile([('s1', 'e2'), ('s2', 'w1'), ('e1', 'n2'),
                              ('n1', 'w2')])

        self.assertAlmostEqual(player.current_tile, None)
        self.assertAlmostEqual(player.current_port, None)
        self.assertAlmostEqual(len(empty_board.tiles), 0)

        try:
            empty_board.first_turn(player, hand_tile, "a1", "n1")
        except:
            print("Tile choice is suicide")

        empty_board.first_turn(player, hand_tile, "a1", "n2")

        self.assertAlmostEqual(player.current_tile, "a1")
        self.assertAlmostEqual(player.current_port, "e1")
        self.assertAlmostEqual(len(empty_board.tiles), 1)
        self.assertAlmostEqual("a1" in empty_board.tiles, True)
        self.assertAlmostEqual(empty_board.tiles["a1"].paths, hand_tile.paths)
Exemplo n.º 19
0
    (255, 255, 255))

#==============================================================================

gameover = 0  # Set to one when the player is dead.
campos = [0, 0, 1]  # Position of the camera. [2] is the zoom level.
zooming = 0  # Zoomeh

#==============================================================================

calcpersecond = 1  # Number of gravity iterations per
calccounter = 0  # iteration of the main loop.

#==============================================================================

avatar = Avatar([0, 0])  # The player's ship.

planets += map(
    lambda x: RandomPlanet([0, 0], 200),  # Add some random planets to
    range(0, 25)) + [avatar]  # planets.

ships += [avatar]  # Add a reference to the player to ships.

fx += map(
    lambda thruster: AffixedEmitter(thruster, 3),  # Add references to the
    avatar.thrusters)  # avatar rockets to fx.

#==============================================================================

starfield = StarfieldDoppler(
    (
Exemplo n.º 20
0
from avatar import Avatar

app = flask.Flask(__name__)


@app.route('/turn/', methods=['POST'])
def process_turn():
    data = flask.request.get_json()

    world_map = WorldMap(**data['world_map'])
    avatar_state = AvatarState(**data['avatar_state'])

    action = avatar.handle_turn(avatar_state, world_map)

    return flask.jsonify(action=action.serialise())


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    global avatar
    with open('{}/options.json'.format(sys.argv[3])) as option_file:
        options = json.load(option_file)
    avatar = Avatar(**options)

    app.config['DEBUG'] = False
    app.run(
        host=sys.argv[1],
        port=int(sys.argv[2]),
    )
Exemplo n.º 21
0
import sys
import time
import logging

import settings
from avatar import Avatar
from server import Server

log = logging.getLogger('spade_example')
log.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
log.addHandler(handler)

if __name__ == '__main__':

    avatar = Avatar(settings.AGENT_JID, settings.AGENT_PASS)
    avatar.start()

    while True:
        try:
            time.sleep(1)
        except KeyboardInterrupt:
            break
    avatar.stop()
Exemplo n.º 22
0
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
log.addHandler(handler)



if __name__ == '__main__':
    server = Server(
        settings.SERVER_JID,
        settings.SERVER_PASS
    )
    server.start()


    avatar = Avatar(
        settings.AGENT_JID,
        settings.AGENT_PASS
    )
    avatar.start()


    avatar2 = Avatar(
        settings.AGENT2_JID,
        settings.AGENT2_PASS
    )
    avatar2.start()


    while True:
        try:
            time.sleep(1)
        except KeyboardInterrupt:
Exemplo n.º 23
0
import sys
sys.path.append('.')
from avatar import Avatar
if __name__ == '__main__':
    avat = Avatar()
    avat._get_img_list()
Exemplo n.º 24
0
    def test_check_first_turn(self):
        rc = RuleChecker()
        empty_board = Board()
        player = Avatar("white")
        suicide_tile = HandTile([('s1', 's2'), ('e2', 'e1'), ('n2', 'n1'),
                                 ('w1', 'w2')])
        tile = HandTile([('n1', 's2'), ('n2', 'e2'), ('e1', 'w2'),
                         ('s1', 'w1')])

        # Not on edge
        not_the_edge = rc.check_first_turn(empty_board, suicide_tile, "c7",
                                           "w2")
        self.assertAlmostEqual(not_the_edge["legal"], False)
        self.assertAlmostEqual(not_the_edge["rules broken"], [
            "tile placement is not on the board's edge",
            "starting port is invalid"
        ])

        # No suicides
        suicide_move = rc.check_first_turn(empty_board, suicide_tile, "a1",
                                           "n1")
        self.assertAlmostEqual(suicide_move["legal"], False)
        self.assertAlmostEqual(suicide_move["rules broken"],
                               ["tile placement is avoidable suicide"])
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, suicide_tile, "a1",
                                "n2")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, suicide_tile, "a1",
                                "w1")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, suicide_tile, "a1",
                                "w2")["legal"], False)

        # No iterior ports allowed
        interior_port_move = rc.check_first_turn(empty_board, suicide_tile,
                                                 "a1", "e2")
        self.assertAlmostEqual(interior_port_move["legal"], False)
        self.assertAlmostEqual(interior_port_move["rules broken"],
                               ["starting port is invalid"])
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a1", "n2")["legal"], True)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a1", "s2")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a1", "w2")["legal"], True)

        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a2", "e1")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a2", "n1")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a2", "s1")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "a2", "w1")["legal"], True)

        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "b1", "e2")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "b1", "n2")["legal"], True)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "b1", "s2")["legal"], False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "b1", "w2")["legal"], False)

        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "j10", "e2")["legal"], True)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "j10", "n2")["legal"],
            False)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "j10", "s2")["legal"], True)
        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "j10", "w2")["legal"],
            False)

        empty_board.first_turn(player, tile, "a1", "n1")

        # No neighbors
        placed_on_occupied_spot = rc.check_first_turn(empty_board, tile, "a1",
                                                      "s2")
        self.assertAlmostEqual(placed_on_occupied_spot["legal"], False)
        self.assertAlmostEqual(placed_on_occupied_spot["rules broken"], [
            'coordinate is already occupied', 'starting port is invalid',
            'tile placement is avoidable suicide'
        ])

        placed_tile_with_neighbors = rc.check_first_turn(
            empty_board, tile, "a1", "s1")
        self.assertAlmostEqual(placed_tile_with_neighbors["legal"], False)
        self.assertAlmostEqual(placed_tile_with_neighbors["rules broken"], [
            'coordinate is already occupied', 'starting port is invalid',
            'tile placement is avoidable suicide'
        ])

        self.assertAlmostEqual(
            rc.check_first_turn(empty_board, tile, "b1", "e2")["legal"], False)
Exemplo n.º 25
0
import numpy as np
import functools
import tensorflow as tf

from time import time
from avatar import Avatar
import dynamic_fixed_point as dfxp

avatar = Avatar()


def average_gradients(tower_grads):
    avg_grads = []
    for grad_and_vars in zip(*tower_grads):
        grads = [g for g, _ in grad_and_vars]
        grad = tf.reduce_mean(tf.stack(grads), axis=0)
        v = grad_and_vars[0][1]
        avg_grads.append((grad, v))
    return avg_grads


def tower_reduce_mean(towers):
    return tf.reduce_mean(tf.stack(towers), axis=0)


def write_file(file_name, num, b, h, w, c):
    print(np.array(num).shape)
    file = open(file_name, 'w')
    for i in range(b):
        for j in range(h):
            for m in range(w):
Exemplo n.º 26
0
 def __init__(self):
     engine.display.set_caption('Nexus')
     self.screen = engine.display.get_surface()
     self.width = self.screen.get_width()
     self.height = self.screen.get_height()
     self.background = engine.Surface((self.width, self.height))
     self.control = Control(self)
     if env.platform in ('pc', 'jvm'):
         self.adjust = False
     else:
         self.adjust = False
     self.collide_mask = engine.sprite.collide_mask
     self.data = engine.sprite.RenderUpdates()
     self.network = engine.sprite.RenderUpdates()  #nodes
     self.network_node = engine.sprite.RenderUpdates()  #nodes to update
     self.level = 1
     self.bot = None
     self.bots = engine.sprite.RenderUpdates()
     self.avatar = Avatar(self, 250, 550)
     self.avatars = engine.sprite.RenderUpdates(self.avatar)
     self.pulses = engine.sprite.RenderUpdates()
     self.charges = engine.sprite.RenderUpdates()
     self.data_construct = []
     engine.display.set_icon(self.avatar.image)
     self.quit = False
     self.update_rect = []
     self.nodes = [(x, y) for x in range(50, self.width, 50)
                   for y in range(50, self.height + 50, 50)]
     self.node_id = [(x, y) for x in range(1, int(self.width / 50))
                     for y in range(1, int((self.height + 50) / 50))]
     self.nodex = [(x, -20) for x in range(50, self.width, 50)]
     self.node = {}
     for i in range(len(self.nodes)):
         node_pos = self.nodes[i]
         identity = self.node_id[i]
         if identity == (5, 10):
             node = Core(self, node_pos[0], node_pos[1], identity)
             self.nexus = node
         else:
             node = Node(self, node_pos[0], node_pos[1], identity)
         self.node[identity] = node
         self.network.add(node)
     self.directions = ['u', 'd', 'l', 'r']
     self.data_count = 0
     self.data_max = 25
     self.time_prev = 0
     self.time_diff = 0
     self.data_event = engine.USEREVENT
     self.data_event_time = 500
     self.surge_event = engine.USEREVENT + 1
     self.surge_event_time = 15555
     self.spike_event = engine.USEREVENT + 2
     self.spike_event_time = 21500
     self.bot_event = engine.USEREVENT + 3
     self.bot_event_time = 5000
     self.level_event = engine.USEREVENT + 4
     self.level_event_time = 60000
     if env.platform == 'pc':
         self.set_timer = engine.time.set_timer
     else:
         from util import set_timer
         self.set_timer = set_timer
     self.draw_grid()
     self.active = True
Exemplo n.º 27
0
 def __init__(self, ip, puerto):
     self.ip = ip
     self.puerto = puerto
     self.avatares = [
         Avatar(0,500,["img/jugador0/walkFront003.png","img/jugador0/walkFront004.png","img/jugador0/walkFront005.png","img/jugador0/idle.png","img/jugador0/walkFront000.png","img/jugador0/walkFront001.png","img/jugador0/walkFront002.png"],False),
         Avatar(0,500,["img/jugador1/walkFront003.png","img/jugador1/walkFront004.png","img/jugador1/walkFront005.png","img/jugador1/idle.png","img/jugador1/walkFront000.png","img/jugador1/walkFront001.png","img/jugador1/walkFront002.png"],False),
         Avatar(0,500,["img/jugador2/walkFront003.png","img/jugador2/walkFront004.png","img/jugador2/walkFront005.png","img/jugador2/idle.png","img/jugador2/walkFront000.png","img/jugador2/walkFront001.png","img/jugador2/walkFront002.png"],False),
         Avatar(0,500,["img/jugador3/walkFront003.png","img/jugador3/walkFront004.png","img/jugador3/walkFront005.png","img/jugador3/idle.png","img/jugador3/walkFront000.png","img/jugador3/walkFront001.png","img/jugador3/walkFront002.png"],False),
         Avatar(0,500,["img/jugador4/walkFront003.png","img/jugador4/walkFront004.png","img/jugador4/walkFront005.png","img/jugador4/idle.png","img/jugador4/walkFront000.png","img/jugador4/walkFront001.png","img/jugador4/walkFront002.png"],False),
         Avatar(0,500,["img/jugador5/walkFront003.png","img/jugador5/walkFront004.png","img/jugador5/walkFront005.png","img/jugador5/idle.png","img/jugador5/walkFront000.png","img/jugador5/walkFront001.png","img/jugador5/walkFront002.png"],False),
         Avatar(0,500,["img/jugador6/walkFront003.png","img/jugador6/walkFront004.png","img/jugador6/walkFront005.png","img/jugador6/idle.png","img/jugador6/walkFront000.png","img/jugador6/walkFront001.png","img/jugador6/walkFront002.png"],False),
         Avatar(0,500,["img/jugador7/walkFront003.png","img/jugador7/walkFront004.png","img/jugador7/walkFront005.png","img/jugador7/idle.png","img/jugador7/walkFront000.png","img/jugador7/walkFront001.png","img/jugador7/walkFront002.png"],False),
         Avatar(0,500,["img/jugador8/walkFront003.png","img/jugador8/walkFront004.png","img/jugador8/walkFront005.png","img/jugador8/idle.png","img/jugador8/walkFront000.png","img/jugador8/walkFront001.png","img/jugador8/walkFront002.png"],False),
         Avatar(0,500,["img/jugador9/walkFront003.png","img/jugador9/walkFront004.png","img/jugador9/walkFront005.png","img/jugador9/idle.png","img/jugador9/walkFront000.png","img/jugador9/walkFront001.png","img/jugador9/walkFront002.png"],False),
         Avatar(0,500,["img/jugador10/walkFront003.png","img/jugador10/walkFront004.png","img/jugador10/walkFront005.png","img/jugador10/idle.png","img/jugador10/walkFront000.png","img/jugador10/walkFront001.png","img/jugador10/walkFront002.png"],False),
         Avatar(0,500,["img/jugador11/walkFront003.png","img/jugador11/walkFront004.png","img/jugador11/walkFront005.png","img/jugador11/idle.png","img/jugador11/walkFront000.png","img/jugador11/walkFront001.png","img/jugador11/walkFront002.png"],False)
     ]
Exemplo n.º 28
0
 def __init__(self, ip, puerto):
     self.ip = ip
     self.puerto = puerto
     self.avatares = [
         Avatar(0, 500, ["img/jugador0/idle.png"], False),
         Avatar(0, 500, ["img/jugador1/idle.png"], False),
         Avatar(0, 500, ["img/jugador2/idle.png"], False),
         Avatar(0, 500, ["img/jugador3/idle.png"], False),
         Avatar(0, 500, ["img/jugador4/idle.png"], False),
         Avatar(0, 500, ["img/jugador5/idle.png"], False),
         Avatar(0, 500, ["img/jugador6/idle.png"], False),
         Avatar(0, 500, ["img/jugador7/idle.png"], False),
         Avatar(0, 500, ["img/jugador8/idle.png"], False),
         Avatar(0, 500, ["img/jugador9/idle.png"], False),
         Avatar(0, 500, ["img/jugador10/idle.png"], False),
         Avatar(0, 500, ["img/jugador11/idle.png"], False)
     ]