Beispiel #1
0
def display_win():
    win_surface = DrawingFunctions.get_transparent_surface(GAME_WIDTH, GAME_HEIGHT, TRANSPARENT_ALPHA, WHITE)

    if x_turn:
        won_sign = X_SIGN
    else:
        won_sign = O_SIGN
    text = create_text(f'Player {won_sign.upper()} Won!', DEFAULT_TEXT_FONT, DEFAULT_TEXT_SIZE, BLACK)

    win_surface.blit(text, (GAME_WIDTH // 2 - text.get_width() // 2, GAME_HEIGHT // 2 - text.get_height() // 2))
    screen.blit(win_surface, (0, 0))
Beispiel #2
0
def display_draw():
    draw_surface = DrawingFunctions.get_transparent_surface(GAME_WIDTH, GAME_HEIGHT, TRANSPARENT_ALPHA, WHITE)
    text = create_text('Draw', DEFAULT_TEXT_FONT, DEFAULT_TEXT_SIZE, BLACK)

    draw_surface.blit(text, (GAME_WIDTH // 2 - text.get_width() // 2, GAME_HEIGHT // 2 - text.get_height() // 2))
    screen.blit(draw_surface, (0, 0))