From 2d887c2c2bbe1492fee3e459e4bf17abe2163628 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sun, 15 Sep 2019 15:31:24 +0200 Subject: fixes on RandomLevels.py, rename rnglevel in rnglevel.py, convert a float division to int division --- bubbob/levels/RandomLevels.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bubbob/levels/RandomLevels.py b/bubbob/levels/RandomLevels.py index 708c87f..16cc5ef 100644 --- a/bubbob/levels/RandomLevels.py +++ b/bubbob/levels/RandomLevels.py @@ -233,7 +233,7 @@ class Shape: rng_angle[self.lines])) if self.platforms: nplat = dice(2,4,0) - if nplat: space = flat((lvl.HEIGHT-1)/nplat/2,(lvl.HEIGHT-1)/nplat/2-1) + if nplat: space = flat((lvl.HEIGHT-1)//nplat//2,(lvl.HEIGHT-1)//nplat//2-1) else: space = 1 if self.platholes: nholes = lambda : dice(1,3) @@ -278,8 +278,8 @@ class Shape: if self.straightfall: lvl.genwalls.append((RandomLevel.prevent_straight_fall, )) - if self.mirrored: - lvl.genwalls.append((RandomLevel.mirror, )) + if self.mirrored: + lvl.genwalls.append((RandomLevel.mirror, )) if self.enlargeholes: lvl.genwalls.append((RandomLevel.enlarge_tiny_holes, )) @@ -358,5 +358,5 @@ if __name__ == '__main__': print(s.__dict__) else: rnglevel = {} - exec(compile(open('levels/rnglevel', "rb").read(), 'levels/rnglevel', 'exec'), rnglevel) + exec(compile(open('levels/rnglevel.py', "rb").read(), 'levels/rnglevel.py', 'exec'), rnglevel) RandomLevel = rnglevel['RandomLevel'] -- cgit v1.2.3