| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3d26d2e commit 4e98f97
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,9 +17,10 @@ def caracter(self, tempo): | |||
| 17 | 17 | else: | |
| 18 | 18 | return self._caracter_destruido | |
| 19 | 19 | ||
| 20 | - def __init__(self, x=0, y=0): | ||
| 20 | + def __init__(self, x=0, y=0, canvas=None): | ||
| 21 | 21 | self.y = y | |
| 22 | 22 | self.x = x | |
| 23 | + self.canvas = canvas | ||
| 23 | 24 | self._tempo_de_colisao = None | |
| 24 | 25 | ||
| 25 | 26 | def status(self, tempo): | |
@@ -58,14 +59,14 @@ class Porco(Ator): | |||
| 58 | 59 | _caracter_ativo = '@' | |
| 59 | 60 | ||
| 60 | 61 | ||
| 61 | - GRAVIDADE = 10 # m/s^2 | ||
| 62 | + GRAVIDADE = 30 # m/s^2 | ||
| 62 | 63 | ||
| 63 | 64 | ||
| 64 | 65 | class Passaro(Ator): | |
| 65 | 66 | _velocidade_scalar = None | |
| 66 | 67 | ||
| 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) | ||
| 69 | 70 | self._x_inicial = x | |
| 70 | 71 | self._y_inicial = y | |
| 71 | 72 | self._tempo_de_lancamento = None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | class Ponto(): | |
| 7 | - def __init__(self, x, y, caracter): | ||
| 7 | + def __init__(self, x, y, caracter, canvas=None): | ||
| 8 | 8 | self.caracter = caracter | |
| 9 | + self.canvas = canvas | ||
| 9 | 10 | self.x = x | |
| 10 | 11 | self.y = y | |
| 11 | 12 | ||
@@ -54,7 +55,7 @@ def calcular_pontos(self, tempo): | |||
| 54 | 55 | return pontos | |
| 55 | 56 | ||
| 56 | 57 | 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) | ||
| 58 | 59 | ||
| 59 | 60 | def _calcular_ponto_de_passaro(self, passaro, tempo, ): | |
| 60 | 61 | passaro.calcular_posicao(tempo) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,6 @@ | |||
| 9 | 9 | except: | |
| 10 | 10 | pass | |
| 11 | 11 | import select | |
| 12 | - from templates import FIM | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | eh_windows = platform.system() == 'Windows' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments