Skip to content

Commit 9e026f0

Browse files
author
renzon
committed
Removendo pontos que não precisam ser plotados para facilitar renderização
1 parent 79ebf92 commit 9e026f0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

placa_grafica_tkinter.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@
3636

3737

3838
def plotar(camada_de_atores, ponto):
39-
x = ponto.x
40-
y = ALTURA_DA_TELA - ponto.y - 120 # para coincidir com o chao da tela
41-
image = CARACTER_PARA__IMG_DCT.get(ponto.caracter, TRANSPARENTE)
42-
camada_de_atores.create_image((x, y), image=image, anchor=NW)
39+
if ponto.caracter != ' ':
40+
x = ponto.x
41+
y = ALTURA_DA_TELA - ponto.y - 120 # para coincidir com o chao da tela
42+
image = CARACTER_PARA__IMG_DCT.get(ponto.caracter, TRANSPARENTE)
43+
camada_de_atores.create_image((x, y), image=image, anchor=NW)
4344

4445

4546
def animar(tela, camada_de_atores, fase, passo=0.01, delta_t=0.01):
@@ -83,11 +84,11 @@ def _ouvir_comandos_lancamento(evento):
8384
fase.lancar(angulo, tempo)
8485

8586
def _replay(event):
86-
#verificar se a fase ja acabou
87+
# verificar se a fase ja acabou
8788
pass
8889

8990
def _jogar_novamente(event):
90-
#verificar se a fase ja acabou
91+
# verificar se a fase ja acabou
9192
pass
9293

9394
def _finalizar(event):
@@ -104,6 +105,7 @@ def _finalizar(event):
104105
tela.mainloop()
105106
tela.after(passo, _animar)
106107

108+
107109
def rodar_fase(fase):
108110
root.title("Python Birds")
109111
root.geometry("800x600")

0 commit comments

Comments
 (0)