Example #1
0
def fade_up(world, entity, from_scene, to_scene):
    world.add_component(
        entity,
        components.ChangePosition((0, -100), 4, interpolation.Smooth(), True,
                                  fade_out, world))
    world.add_component(entity,
                        components.ChangeAlpha(0, 4, interpolation.Smooth()))
    world.add_component(entity,
                        components.Delay(5, next_scene, from_scene, to_scene))
Example #2
0
 def lowlight(entity):
     t = self.world.component_for_entity(entity, components.Text)
     image = t.font.render(t.text, False, t.color)
     self.world.component_for_entity(entity,
                                     components.Image).image = image
     size = self.world.component_for_entity(entity, components.Size)
     size.width = image.get_width()
     size.height = image.get_height()
     self.world.add_component(
         entity, components.ChangeSize(.5, .25, interpolation.Smooth()))
Example #3
0
 def highlight(entity):
     t = self.world.component_for_entity(entity, components.Text)
     image = t.font.render("> " + t.text + " <", False, (128, 0, 128))
     self.world.component_for_entity(entity,
                                     components.Image).image = image
     size = self.world.component_for_entity(entity, components.Size)
     size.width = image.get_width()
     size.height = image.get_height()
     self.world.add_component(
         entity, components.ChangeSize(1, .25, interpolation.Smooth()))
Example #4
0
 def puzzle_complete():
     if self.world.component_for_entity(mug, components.Flammable).lit:
         p = self.world.component_for_entity(player, components.Player)
         if p.holding is mug:
             p.holding = None
         self.world.delete_entity(mug)
         #self.switch_to_scene(text.TextScene("NaN was unsure how much longer he could go on like this. He still wanted to help people, but was filled with thoughts of inadequacy and self doubt.", SceneSeven()))
         notify(self.world, self.small_font, "Way to take your time.", self, text.TextScene("Eventually he'd had enough. He decided he would get revenge on his town for treating him this way.", SceneSeven()))
     else:
         complaint = create_entity(self.world, "speech.png", pygame.Rect(640, 500, 307, 173))
         self.world.add_component(complaint, components.ChangeAlpha(0, 4, interpolation.Smooth()))
         util.drawText(self.world.component_for_entity(complaint, components.Image).image, "It's cold! Heat it up for me.", (255, 255, 255), pygame.Rect(30, 20, 246, 134), self.small_font)
Example #5
0
 def puzzle_complete():
     if self.world.component_for_entity(mug, components.Flammable).lit:
         p = self.world.component_for_entity(player, components.Player)
         if p.holding is mug:
             p.holding = None
         self.world.delete_entity(mug)
         #self.switch_to_scene(text.TextScene("NaN was unsure how much longer he could go on like this. He still wanted to help people, but was filled with thoughts of inadequacy and self doubt.", SceneSeven()))
         notify(
             self.world, self.small_font, "Way to take your time.",
             self,
             text.TextScene(
                 "Eventually he'd had enough. There was no way he could go back to adventuring, but he similarly could not stop here. He began a new journey, leaving his town without a single goodbye. Thanks for playing.",
                 title.TitleScene()))
     else:
         complaint = create_entity(self.world, "speech.png",
                                   pygame.Rect(640, 500, 307, 173))
         self.world.add_component(
             complaint,
             components.ChangeAlpha(0, 4, interpolation.Smooth()))
         util.drawText(
             self.world.component_for_entity(complaint,
                                             components.Image).image,
             "It's cold! Heat it up for me.", (255, 255, 255),
             pygame.Rect(30, 20, 246, 134), self.small_font)
Example #6
0
 def move_down(entity):
     self.world.add_component(
         entity,
         components.ChangePosition((0, 40), 1, interpolation.Smooth(),
                                   True, move_up, entity))