Exemplo n.º 1
0
def run_game():
    init_log()

    game_state = game_init.init_game()
    log_full_game_state(game_state)
    while not game_state.end():
        run_round(game_state)
        #log_full_game_state(game_state)
    pass
    log_full_game_state(game_state)

    winner = game_state.winner().name
    log(game_state.winner().name + " WINS THE GAME!")

    close_log()
    return (game_state, winner)
    
#run_game()
Exemplo n.º 2
0
import pygame
import sys
from globalvars import *
from card import *
from game_init import init_game
from view import *
from refresh import refresh_scene
import game
from actions import *
from characters import CHARACTERS

pygame.init()
init_log()
# create window
pygame.display.set_caption('Citadels')
gs = init_game()


def get_view(gs):
    scene = {}

    background = Drawable(BACKGROUND_IMAGE)
    scene['background'] = [background]

    scene['frames'] = []
    scene['slots'] = []
    scene['slot_cards'] = []
    scene['portraits'] = []
    for i in range(COUNT_OF_PLAYERS - 1):
        p = gs.players[i+1]
        frame = AIPlayerFrame(p, i, p.role == gs.killed, gs.is_crown_owner(p))