forked from pythonprobr/pythonbirds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathescudo_espartano.py
More file actions
43 lines (33 loc) · 937 Bytes
/
escudo_espartano.py
File metadata and controls
43 lines (33 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
from os import path
import sys
import math
project_dir = path.dirname(__file__)
project_dir = path.join('..')
sys.path.append(project_dir)
from atores import PassaroAmarelo, PassaroVermelho, Obstaculo, Porco
from fase import Fase
from placa_grafica_tkinter import rodar_fase
from random import randint
if __name__ == '__main__':
fase = Fase(intervalo_de_colisao=32)
# Adicionar Pássaros Amarelos
for i in range(80):
fase.adicionar_passaro(PassaroAmarelo(30, 30))
# Obstaculos
theta = 270
h = 12
k = 7
step = 32
r = 50
while theta < 480:
x = 600 + (h + r * math.cos(theta))
y = (k + r * math.sin(theta))
fase.adicionar_obstaculo(Obstaculo(x, y))
theta += 32
# Porcos
for i in range(30, 300, 32):
x = randint(590, 631)
y = randint(0, 21)
fase.adicionar_porco(Porco(x, y))
rodar_fase(fase)