1
Fork 0

addded function to generate fireback targets

This commit is contained in:
Jake Howard 2015-05-07 20:08:47 +01:00
parent 36d6e309ff
commit e819e2e46d

24
game.py
View file

@ -39,15 +39,27 @@ def initialise(menu, options):
return exit_code
def generate_targets():
def generate_targets(player):
group = pygame.sprite.Group()
for i in range(5): # Number of rows
i *= 25
for j in range(50, WINDOW_SIZE[0] - 70, 30):
#logging.debug("Target generated with position ({},{})".format(j,i))
level = Levels[player.level]
for i in range(level.rows):
i *= level.padding
for j in range(50, WINDOW_SIZE[0] - 70, level.padding):
temp = Target(x=j,y=i)
if randint(0, )
group.add(temp)
del temp
del temp
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"
changed = True
else:
group[randint(0, len(group)-1)].type != "NORMAL"
return group