Mercurial > scrounge
changeset 13:028bb963b92b
remove unused generator
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sun, 21 Aug 2011 20:09:43 +0200 |
| parents | 7179a8e8134f |
| children | 2fee7a784843 |
| files | generator.py |
| diffstat | 1 files changed, 0 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/generator.py Sun Aug 21 20:09:21 2011 +0200 +++ b/generator.py Sun Aug 21 20:09:43 2011 +0200 @@ -5,36 +5,6 @@ import thing -class SimpleLevelGenerator(object): - def __init__(self): - self.map = [['.'] * 30 for i in range(30)] - for i in range(200): - x = random.randint(1, 24) - y = random.randint(1, 24) - w = random.randint(4, min(8, 28 - x)) - h = random.randint(4, min(8, 28 - y)) - self.rect(x, y, w, h, 'x') - self.rect(x + 1, y + 1, w - 2, h - 2, '.') - self.rect(x - 1, y - 1, w + 2, h + 2, '.') - if random.choice([True, False]): - self.map[y + random.randint(1, h - 2)][x] = '+' - if random.choice([True, False]): - self.map[y][x + random.randint(1, w - 2)] = '+' - if random.choice([True, False]): - self.map[y + random.randint(1, h - 2)][x + w] = '+' - if random.choice([True, False]): - self.map[y + h][x + random.randint(1, w - 2)] = '.' - self.rect(0, 0, 29, 29, 'x') - - def rect(self, sx, sy, w, h, c): - for y in range(sy, sy + h + 1): - self.map[y][sx] = c - self.map[y][sx + w] = c - for x in range(sx, sx + w + 1): - self.map[sy][x] = c - self.map[sy + h][x] = c - - class LevelGenerator(object): def __init__(self): self.map = [['x'] * 30 for i in range(30)]
