Skip to content

Commit 4e98f97

Browse files
adicionando interface tkinter para o jogo
1 parent 3d26d2e commit 4e98f97

File tree

11 files changed

+114
-7
lines changed

11 files changed

+114
-7
lines changed

atores.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ def caracter(self, tempo):
1717
else:
1818
return self._caracter_destruido
1919

20-
def __init__(self, x=0, y=0):
20+
def __init__(self, x=0, y=0, canvas=None):
2121
self.y = y
2222
self.x = x
23+
self.canvas = canvas
2324
self._tempo_de_colisao = None
2425

2526
def status(self, tempo):
@@ -58,14 +59,14 @@ class Porco(Ator):
5859
_caracter_ativo = '@'
5960

6061

61-
GRAVIDADE = 10 # m/s^2
62+
GRAVIDADE = 30 # m/s^2
6263

6364

6465
class Passaro(Ator):
6566
_velocidade_scalar = None
6667

67-
def __init__(self, x=0, y=0):
68-
super().__init__(x, y)
68+
def __init__(self, x=0, y=0, canvas=None):
69+
super().__init__(x, y, canvas)
6970
self._x_inicial = x
7071
self._y_inicial = y
7172
self._tempo_de_lancamento = None

fase.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55

66
class Ponto():
7-
def __init__(self, x, y, caracter):
7+
def __init__(self, x, y, caracter, canvas=None):
88
self.caracter = caracter
9+
self.canvas = canvas
910
self.x = x
1011
self.y = y
1112

@@ -54,7 +55,7 @@ def calcular_pontos(self, tempo):
5455
return pontos
5556

5657
def _transformar_em_ponto(self, ator, tempo):
57-
return Ponto(ator.x, ator.y, ator.caracter(tempo))
58+
return Ponto(ator.x, ator.y, ator.caracter(tempo), ator.canvas)
5859

5960
def _calcular_ponto_de_passaro(self, passaro, tempo, ):
6061
passaro.calcular_posicao(tempo)

images/background.gif

49.7 KB
Loading

images/background.jpg

706 KB
Loading

images/obstaculo.gif

1.7 KB
Loading

images/passaro_amarelo.gif

1.84 KB
Loading

images/passaro_vermelho.gif

1.85 KB
Loading

images/porco.gif

1.72 KB
Loading

images/porco_morto.gif

1.56 KB
Loading

placa_grafica.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
except:
1010
pass
1111
import select
12-
from templates import FIM
1312

1413

1514
eh_windows = platform.system() == 'Windows'

0 commit comments

Comments
 (0)