Ejemplo n.º 1
0
    def init_game(self, player_msg):

        self.players = {}
        self.loading = False
        self.running = True

        for player in player_msg.items():
            # player[0] is player_number
            # player[1] is instruction
            # player[2] is player type
            player_info = player[1]
            x_axis = player_info[0]
            y_axis = player_info[1]
            new_player = Player(x_axis, y_axis, player[0])

            if player_info[2] == 'wolf':
                new_player.becomes_it()

            self.players[player[0]] = new_player
Ejemplo n.º 2
0
    def init_game(self, player_msg, board):

        self.players = {}
        self.loading = False
        self.running = True

        for border in board:
            self.borders.append(pygame.Rect(border[0], border[1], border[2], border[3]))

        for player in player_msg.items():
            # player[0] is player_number
            # player[1] is instruction
            # player[2] is player type
            player_info = player[1]
            x_axis = player_info[0]
            y_axis = player_info[1]
            new_player = Player(x_axis, y_axis, player[0])

            if player_info[2] == 'wolf':
                new_player.becomes_it()

            self.players[player[0]] = new_player