randomly rotate serum puddles
authoradrianna <adrianna.pinska@gmail.com>
Sat, 5 Mar 2016 19:14:00 +0000 (21:14 +0200)
committeradrianna <adrianna.pinska@gmail.com>
Sat, 5 Mar 2016 19:14:12 +0000 (21:14 +0200)
koperkapel/serums.py

index 40ebfbac59f11950847f662e80906e6107e6c4a7..38794fd4926834bba5129b650f836e944c534490 100644 (file)
@@ -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()