Skip to content

Commit d4df8bb

Browse files
adicionando botoes de sair, replay e jogar novamente
1 parent 74e1dad commit d4df8bb

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

placa_grafica_tkinter.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
TRANSPARENTE = PhotoImage(file=path.join(IMAGES_PATH, "transparente.gif"))
2424
BACKGROUND = PhotoImage(file=path.join(IMAGES_PATH, "background.gif"))
2525
PYTHONBIRDS_LOGO = PhotoImage(file=path.join(IMAGES_PATH, "python-birds-logo.gif"))
26+
MENU = PhotoImage(file=path.join(IMAGES_PATH, "menu.gif"))
2627
VOCE_GANHOU = PhotoImage(file=path.join(IMAGES_PATH, "python-birds-voce-ganhou-popup.gif"))
2728
VOCE_PERDEU = PhotoImage(file=path.join(IMAGES_PATH, "python-birds-voce-perdeu-popup.gif"))
2829

@@ -63,6 +64,7 @@ def _animar():
6364

6465
if fase.acabou(tempo):
6566
camada_de_atores.create_image(162, 55, image=PYTHONBIRDS_LOGO, anchor=NW)
67+
camada_de_atores.create_image(54, 540, image=MENU, anchor=NW)
6668
if 'ganhou' in fase.status(tempo):
6769
img = VOCE_GANHOU
6870
else:
@@ -80,18 +82,24 @@ def _ouvir_comandos_lancamento(evento):
8082
elif evento.keysym == 'Return' or evento.keysym == 'space':
8183
fase.lancar(angulo, tempo)
8284

83-
def _replay():
85+
def _replay(event):
86+
#verificar se a fase ja acabou
8487
pass
8588

86-
def _jogar_de_novo():
89+
def _jogar_novamente(event):
90+
#verificar se a fase ja acabou
8791
pass
8892

89-
def _finalizar():
93+
def _finalizar(event):
9094
root.destroy()
9195

9296
camada_de_atores.pack()
9397
_animar()
9498
tela.bind_all('<KeyPress>', _ouvir_comandos_lancamento)
99+
tela.bind_all('1', _replay)
100+
tela.bind_all('2', _jogar_novamente)
101+
tela.bind_all('3', _finalizar)
102+
tela.bind_all('esc', _finalizar)
95103

96104
tela.mainloop()
97105
tela.after(passo, _animar)

0 commit comments

Comments
 (0)