Esempio n. 1
0
    def setup(self):
        pygame.mixer.music.set_volume(0.50)
        play_song(self.song)
        font = pygame.font.Font(None, 30)

        tb = TextBlock(font, justify=TextBlock.LEFT)
        self.text = tb.render(
            """
Archibald the Robot lived a happy existence with his robo-family, 
until one day their planet was bombarded by meteors! 
Navigate Archie around the screen to help rescue his family members
from falling meteors. 
Move quickly to avoid the meteors.
When Archie is carrying a family member, he will be significantly slowed.

Controls: 
 * Move around with W A S D keys.
 * Space picks up family members. 
 * ESC pauses the game.
 * ESC + q brings you back to the menu screen.

Hit <SPACE> to continue.

Good luck!
""".strip().split(
                "\n"
            ),
            True,
            self.fg_color,
            self.bg_color,
        )
Esempio n. 2
0
    def setup(self):
        pygame.mixer.music.set_volume(0.50)
        # play_song(self.song)
        font = pygame.font.Font(None, 30)
        self.BG_IMAGE = load_image("menuscreenblank")

        tb = TextBlock(font, justify=TextBlock.LEFT)
        self.text = tb.render(
            """The Meteors are coming, so we have to teach you fast!
Archie is strong, but his family is heavy and he'll get tired if
he carries someone for too long.  Think strategically!

In addition, each family member has a special power to help:
Sisterbot will jump away if she is hit.
Brotherbot will bat away rocky meteors.
Motherbot protects herself with an umbrella.
Fatherbot is immune to ice and fire meteors.
Babybot is very light and easy to carry.

SURVIVE AS LONG AS YOU CAN.  HERE THEY COME!!!
<press space to continue>

""".strip().split(
                "\n"
            ),
            True,
            self.fg_color,
            self.bg_color,
        )
Esempio n. 3
0
    def parse(self, context):

        (counters,
         content) = iterate.AbstractIteratorToken.parse(self, context)

        #  we put this here since we still need to process the inner content up to @end even for an empty range!
        if len(counters) == 0:
            return

        block = BlockSequence([TextBlock('('), content, TextBlock(')')])
        for counter in reversed(counters):
            block = IterationBlock(counter,
                                   block,
                                   before='(',
                                   between=' + ',
                                   after=')')

        return block
Esempio n. 4
0
    def setup(self):
        font = pygame.font.Font(None, 50)

        tb = TextBlock(font, justify=TextBlock.CENTER)
        self.text = tb.render(
            (
                """
GAME OVER! 
Your score is: %d

Hit ESC to quit

or <space> to return to the Main Menu!
"""
                % (self.app.state.timer / 30)
            )
            .strip()
            .split("\n"),
            True,
            self.fg_color,
            self.bg_color,
        )