-
Notifications
You must be signed in to change notification settings - Fork 1
/
inimigos.py
32 lines (28 loc) · 974 Bytes
/
inimigos.py
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
import pygame
from elementos_base import *
from nave import *
import random
linhas = level
colunas = 8
aliens_lista = []
alienrect_lista = []
#cria e posiciona os aliens
for linha in range(linhas):
for coluna in range(colunas):
png_alien = pygame.image.load("imagens\Inimigo" + str(random.randint(1,4)) + ".png")
alien = pygame.transform.scale(png_alien, (60,65))
alien_rect = alien.get_rect()
aliens_lista.append(alien)
alienrect_lista.append(alien_rect)
alien_rect.center = (85 + coluna * 90, linha * 70 + 60)
#desenha os aliens nos seus respectivos rects
def desenha_aliens():
for i in range (len(alienrect_lista)):
tela.blit(aliens_lista[i], alienrect_lista[i])
#cria tiro do alien
png_tiroalien = pygame.image.load("imagens\Teste.png")
tiroalien = pygame.transform.scale(png_tirojogador, (6, 12))
tiroalien_lista = []
tiroalienrect_lista = []
cooldown_alien = 800 - (50 * level)
ultimo_tiroalien = 0