From: adrianna Date: Sat, 5 Mar 2016 19:14:00 +0000 (+0200) Subject: randomly rotate serum puddles X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=7bdd34d38339dd7c2d20d6b1c75e0d223ca5b7f3;p=koperkapel.git randomly rotate serum puddles --- diff --git a/koperkapel/serums.py b/koperkapel/serums.py index 40ebfba..38794fd 100644 --- a/koperkapel/serums.py +++ b/koperkapel/serums.py @@ -1,7 +1,9 @@ """ Tools for creating serum actors. """ +import random from pgzero.loaders import images from pygame.constants import BLEND_RGBA_MULT +from pygame.transform import rotate from .actors.surf import SurfActor SERUMS = ["smart", "fast", "strong"] @@ -41,6 +43,7 @@ class SerumFactory: def assemble(self, name): assert name in SERUMS puddle = images.load("serum%s/serum" % (self.suffix,)) + puddle = rotate(puddle, 90 * random.randint(0, 3)) serum_icon = images.load("serum%s/%s" % ( self.suffix, SERUM_TILENAME_MAP[name],)) frame = puddle.copy()