From ef48e91b821ad524a9de9f43decc45dd7a24ef07 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 8 May 2015 10:11:32 +0100 Subject: [PATCH] added more levels, and a random levels --- assets.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/assets.py b/assets.py index 9971a94..4e6fe1c 100644 --- a/assets.py +++ b/assets.py @@ -1,6 +1,6 @@ import os, pygame, glob, logging from collections import namedtuple - +from random import randint class Textures(): def __init__(self): @@ -32,6 +32,13 @@ class Textures(): Level_Template = namedtuple('Level_Template', ("rows", "padding", "firebacks", "powerups")) Levels = [ Level_Template(2, 30, 0, 0), - Level_Template(3, 15, 0, 0), - Level_Template(3, 20, 2, 0) + Level_Template(3, 15, 0, 1), + Level_Template(3, 20, 2, 1) ] + +def generate_random_level(): + rows = randint(0, 12) + padding = randint(5, 75) + firebacks = randint(0, 15) + powerups = randint(0, 15) + return Level_Template(rows, padding, firebacks, powerups) \ No newline at end of file