コード例 #1
0
ファイル: example_game.py プロジェクト: lidkas/PZSP1
                    player1.player_cards(screen, True)
                    select_card_to_remove(player1, (mouse_x, mouse_y))
                else:
                    musik_removed = True
            else:

                # jeżeli tura w db zgadza się z twoim numerem odpalana jest funkcja gry
                if who_playing == game.get_ownership():
                    screen.blit(text_render_player_one_turn, (350, 500))
                    check_if_oponnent_card(player2)
                    select_card(player1, (mouse_x, mouse_y))
                    check_selected_card(player2, player1)
                    player1.remove_from_player(player1.selected_card)
                    if player1.selected_card:
                        # 4 + game.get_ownership() // czyli 1 lub dwa, da nam to karte gracza 1 lub 2
                        game.change_card_owner(4 + game.get_ownership(),
                                               player1.selected_card.card_id)
                        game.set_game_info(3, 3 - game.get_ownership())

                # wyświetlanie kart
                if player2.selected_card:
                    play_oponnent_card(screen, player2)
                if player1.selected_card:
                    play_selected_card(screen, player1)

                if get_player_turn() == (3 - game.get_ownership()):
                    screen.blit(text_render_player_two_turn, (350, 100))

                player1.player_cards(screen, True)
                player2.player_cards(screen, False)
            player_scores(screen, player1, player2)
            if player1.selected_card is not None and player2.selected_card is not None:
コード例 #2
0
        # 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)
                    check_selected_card(player2, player1)
                    player1.remove_from_player(player1.selected_card)
                    if player1.selected_card:
                        game.change_card_owner(5,
                                               player1.selected_card.card_id)
                        set_game_info(player1, 2)
                if player2.selected_card:
                    play_oponnent_card(screen, player2)
                if player1.selected_card:
                    play_selected_card(screen, player1)
                if get_player_turn() == 2:
                    screen.blit(text_render_player_two_turn, (350, 100))
                player1.player_cards(screen, True)
                player2.player_cards(screen, False)
            if game.get_ownership() == 2:
                if get_player_turn() == 2:
                    screen.blit(text_render_player_one_turn, (350, 500))
                    check_if_oponnent_card(player1)
                    select_card(player2, mouse_x, mouse_y)
                    check_selected_card(player1, player2)