repeat
authorFrank DeMarco <frank.s.demarco@gmail.com>
Tue, 26 Aug 2014 14:26:33 +0000 (23:26 +0900)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Tue, 26 Aug 2014 14:26:33 +0000 (23:26 +0900)
shaken_and_spit_out/SSO.py

index 046df7e..130f149 100644 (file)
@@ -237,6 +237,7 @@ class Cloud(GameChild):
             layer.add_frame(frame)
             layer.move((0, -5, 5)[ii])
             layer.location.bottom = self.ds.get_height()
+            layer.add_location(offset=(0, -layer.location.h))
             layers.append(layer)
 
     def update(self):
@@ -245,8 +246,7 @@ class Cloud(GameChild):
         ds.set_clip(fr.topleft, (ds.get_width(), ds.get_height() - fr.top))
         for ii, layer in enumerate(self.layers):
             layer.move(dy=1 + (ii * .5))
-            if layer.location.top > fr.top:
-                layer.location.bottom = ds.get_height() + layer.location.top - \
-                                        fr.top
+            if layer.location.top > ds.get_height():
+                layer.move(dy=-layer.location.h)
             layer.update()
         ds.set_clip(None)