instructions
authorFrank DeMarco <frank.s.demarco@gmail.com>
Mon, 29 Aug 2016 23:31:34 +0000 (19:31 -0400)
committerFrank DeMarco <frank.s.demarco@gmail.com>
Mon, 29 Aug 2016 23:31:34 +0000 (19:31 -0400)
HEAVENSlime.py

index 0038098..09a9d65 100644 (file)
@@ -130,6 +130,8 @@ class Arena(Animation):
             y += difference
             platforms.append(Platform(self, y))
         platforms[-1].final = True
+        instructions = self.instructions = Sprite(self, 1000)
+        instructions.load_from_path(self.get_resource("instructions"), True)
         self.register(self.set_gradient, self.restart_game, self.restore_volume)
         self.subscribe(self.respond)
         self.reset()
@@ -154,6 +156,8 @@ class Arena(Animation):
         self.meter.reset()
         for platform in self.platforms:
             platform.reset()
+        self.instructions.unhide()
+        self.instructions.get_current_frameset().reset()
 
     def respond(self, event):
         if self.active and not self.suppressing_input:
@@ -242,6 +246,8 @@ class Arena(Animation):
                 elif self.slime.speed <= 0:
                     for platform in self.platforms:
                         if platform.passed and platform.collide(self.slime):
+                            if not self.instructions.is_hidden():
+                                self.instructions.hide()
                             self.slime.stop()
                             self.shift_world(self.slime.location.bottom - platform.location.top + 1)
                             if abs(self.slime.speed) < Platform.SAFETY_THRESHOLD:
@@ -267,6 +273,8 @@ class Arena(Animation):
                 platform.update()
             self.meter.update()
             self.boosts.update()
+            self.instructions.location.center = self.platforms[0].location.center
+            self.instructions.update()
             self.slime.update()
             self.end.update()
         elif self.set_active_on_update: