Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74e1dad

Browse files
adicionando nova fase
1 parent b20fa64 commit 74e1dad

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

fases/escudo_espartano.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
from os import path
3+
import sys
4+
import math
5+
6+
project_dir = path.dirname(__file__)
7+
project_dir = path.join('..')
8+
sys.path.append(project_dir)
9+
10+
from atores import PassaroAmarelo, PassaroVermelho, Obstaculo, Porco
11+
from fase import Fase
12+
from placa_grafica_tkinter import rodar_fase
13+
from random import randint
14+
15+
if __name__ == '__main__':
16+
fase = Fase(intervalo_de_colisao=10)
17+
18+
19+
# Adicionar Pássaros Amarelos
20+
for i in range(40):
21+
fase.adicionar_passaro(PassaroAmarelo(30, 30))
22+
23+
24+
# Obstaculos
25+
theta = 270
26+
h = 12
27+
k = 7
28+
step = 32
29+
r = 50
30+
31+
while theta < 480:
32+
x = 600 + (h + r * math.cos(theta))
33+
y = (k + r * math.sin(theta))
34+
fase.adicionar_obstaculo(Obstaculo(x, y))
35+
theta += 32
36+
37+
# Porcos
38+
for i in range(30, 300, 32):
39+
x = randint(590, 631)
40+
y = randint(0, 21)
41+
fase.adicionar_porco(Porco(x, y))
42+
43+
rodar_fase(fase)

0 commit comments

Comments
 (0)