示例#1
0
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            terminate_game()
        if event.type == pygame.MOUSEBUTTONDOWN:
            mouse_x, mouse_y = pygame.mouse.get_pos()
    # możliwoć grania z robotem
    if not device_set:
        use_device, ard_conn, models, deal_with_device = device_choice_screen(
            mouse_x, mouse_y, ard_conn)
        device_set = use_device is not None and deal_with_device is not None
    # use_device set False
    if not start_game and device_set:
        screen.fill(bg_green)
        start_game = create_menu(mouse_x, mouse_y)
    if start_game and device_set:
        who_playing = game.get_game_info(3)[0][0]
        if who_playing == 0:
            screen.fill((230, 122, 30))
            screen.blit(text_render_waiting_for_player, (500, 300))
        # markery 3, 4 oznaczają licytacje
        if 3 <= who_playing < 5:
            if not card_given and deal_with_device:
                my_deck = game.select_cards(game.get_ownership())[0]
                ard_conn.deal_cards(my_deck, models)
                card_given = True
                # wydajesz karty graczom
            auction()

        # właściwa runda
        if who_playing == 1 or who_playing == 2:
            screen.fill((0, 122, 30))
示例#2
0
            game.delete_game_record()
            game.delete_current_deck()
            game.reset_auction()
            running = False
            quit()
        if event.type == pygame.MOUSEBUTTONDOWN:
            mouse_x, mouse_y = pygame.mouse.get_pos()
    # możliwoć grania z robotem
    if use_device is None:
        use_device, ard_conn = device_choice_screen(mouse_x, mouse_y)
    # start gry if device not none?, co z grającymi bez bota?
    if not start_game and use_device is not None:
        screen.fill(bg_green)
        start_game = create_menu(mouse_x, mouse_y)
    if start_game and use_device is not None:
        who_playing = game.get_game_info(3)[0][0]
        if who_playing == 0:
            screen.fill((230, 122, 30))
            screen.blit(text_render_waiting_for_player, (500, 300))
        # markery 3, 4 oznaczają licytacje
        if 3 <= who_playing < 5:
            auction()
        # właściwa runda
        if who_playing == 1 or who_playing == 2:
            screen.fill((0, 122, 30))

            if game.get_ownership() == 1:
                if get_player_turn() == 1:
                    screen.blit(text_render_player_one_turn, (350, 500))
                    check_if_oponnent_card(player2)
                    select_card(player1, mouse_x, mouse_y)