Commit 90619c5d authored by Fedrico Otaran's avatar Fedrico Otaran
Browse files

Agrego nuevo tablero

parent 2d577f97
Pipeline #243 failed with stages
in 0 seconds
import PySimpleGUI as sg
from import board
def start():
window = loop()
def loop():
window ="Fede", "Milka")
while True:
event, _values =
if event in (sg.WINDOW_CLOSED, "Exit", "-exit-"):
if event.startswith("cell"):
_prefix, x, y = event.split("-")
print(f"Celda: {x},{y}")
return window
import PySimpleGUI as sg import PySimpleGUI as sg
from import menu from import menu
from src.component import board
def start(): def start():
...@@ -17,12 +18,20 @@ def loop(): ...@@ -17,12 +18,20 @@ def loop():
window = window =
while True: while True:
event, values = event, _values =
if event in (sg.WINDOW_CLOSED, "Exit") or event == "-exit-": if event in (sg.WINDOW_CLOSED, "Exit", "-exit-"):
break break
print(event) if event == "-play-":
print(values) window.hide()
if event == "-settings-":
if event == "-score-":
return window return window
import PySimpleGUI as sg
def build(player1_name, player2_name):
layout = [
[sg.Text('Jugador 1: ' + player1_name, key='-P1-', text_color='darkblue')],
[sg.Text('Jugador 2: ' + player2_name, key='-P2-', text_color='white')],
for y in range(3):
layout += [
[sg.Button(' ', size=(8, 4), key=f"cell-{x}-{y}") for x in range(3)]
board = sg.Window('Ta Te Ti').Layout(layout)
return board
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment