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 src.windows import board
def start():
window = loop()
window.close()
def loop():
window = board.build("Fede", "Milka")
while True:
event, _values = window.read()
if event in (sg.WINDOW_CLOSED, "Exit", "-exit-"):
break
if event.startswith("cell"):
_prefix, x, y = event.split("-")
print(f"Celda: {x},{y}")
return window
import PySimpleGUI as sg
from src.windows import menu
from src.component import board
def start():
......@@ -17,12 +18,20 @@ def loop():
window = menu.build()
while True:
event, values = window.read()
event, _values = window.read()
if event in (sg.WINDOW_CLOSED, "Exit") or event == "-exit-":
if event in (sg.WINDOW_CLOSED, "Exit", "-exit-"):
break
print(event)
print(values)
if event == "-play-":
window.hide()
board.start()
window.un_hide()
if event == "-settings-":
pass
if event == "-score-":
pass
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')],
[sg.Text('')]
]
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
Markdown is supported
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