1
Fork 0

added option for powerups, and implemented speed

This commit is contained in:
Jake Howard 2015-05-07 22:12:16 +01:00
parent b43a2b32b3
commit d1a5e2c0e5
2 changed files with 11 additions and 8 deletions

View file

@ -29,8 +29,9 @@ class Textures():
return pygame.image.load(filename)
Level_Template = namedtuple('Level_Template', (rows, padding, firebacks))
Level_Template = namedtuple('Level_Template', ("rows", "padding", "firebacks", "powerups"))
Levels = [
Level_Template(2, 30, 0),
Level_Template(3, 15, 0)
]
Level_Template(2, 30, 0, 0),
Level_Template(3, 15, 0, 0),
Level_Template(3, 20, 2, 0)
]

10
game.py
View file

@ -54,12 +54,14 @@ def generate_targets(player):
for i in range(level.firebacks):
changed = False
while not changed:
if group[randint(0, len(group)-1)].type != "SHOOTER"
group[randint(0, len(group)-1)].type == "SHOOTER"
index = randint(0, len(group)-1)
if group[index].type != "SHOOTER"
group[index].type == "SHOOTER"
group[index].image.fill((150,0,30))
group[index].rect = group[image].image.get_rect()
changed = True
else:
group[randint(0, len(group)-1)].type != "NORMAL"
group[randint(0, len(group)-1)].type == "NORMAL"
return group