Пример #1
0
 def drawHighestScore(self):
     drawTextCentered(self.screen, text="Highest score:", y=600)
     drawTextCentered(self.screen,
                      text=("{:06d} - {}".format(self.scores[0]["score"],
                                                 self.scores[0]["name"])
                            if self.scores else "{:06d}".format(0)),
                      y=630)
Пример #2
0
 def drawFinishScreen(self):
     self.screen.fill(self.colors["background"])
     drawTextCentered(self.screen,
                      text="You finished the tutorial!",
                      y=200,
                      font_size=64)
     drawTextCentered(self.screen, text="Have fun!", y=350, font_size=36)
Пример #3
0
 def drawPlayerScore(self):
     for coin in self.coins:
         coin.draw()
         coin.updateColor()
     drawTextCentered(self.screen, text="Points:", y=400, font_size=36)
     drawTextCentered(self.screen,
                      text="{:06d}".format(self.player_info["score"]),
                      y=445,
                      font_size=36)
Пример #4
0
 def drawTextInput(self):
     min_name_length = 3
     drawTextCentered(self.screen,
                      text="Enter your name:",
                      y=540,
                      font_size=36)
     drawTextCentered(
         self.screen,
         text="{}_".format(self.name),
         y=580,
         color=self.colors["red"]
         if len(self.name) < min_name_length else self.colors["white"],
         font_size=36)
Пример #5
0
 def drawOptions(self):
     inactive_color = self.colors["grey"]
     active_color = self.colors["white"]
     self.drawOptionDots(active_color, inactive_color)
     drawTextCentered(
         self.screen,
         text="TUTORIAL",
         y=380,
         color=active_color if self.active_option == 0 else inactive_color,
         font_size=64)
     drawTextCentered(
         self.screen,
         text="PLAY",
         y=440,
         color=active_color if self.active_option == 1 else inactive_color,
         font_size=64)
     drawTextCentered(
         self.screen,
         text="EXIT",
         y=500,
         color=active_color if self.active_option == 2 else inactive_color,
         font_size=64)
Пример #6
0
 def drawLevelName(self):
   drawTextCentered(self.screen, text=self.level_name, y=200, font_size=96)
Пример #7
0
 def drawEndMessage(self):
     drawTextCentered(self.screen,
                      text=self.end_game_message,
                      y=200,
                      font_size=128)
Пример #8
0
 def drawLogo(self):
     drawTextCentered(self.screen, text="Rectov", y=100, font_size=256)
Пример #9
0
    def writeMessage(self, camera):
        """ TODO: try to make this piece of code look better """
        # Messages for first tutorial
        if self.level["id"] == 0:
            drawText(self.screen, text="Move:", x=140, y=100, font_size=64)
            self.keys_sprite_sheet.drawTexture(
                texture_name="a-activated"
                if self.keys_pressed["left"] else "a",
                x=140,
                y=180,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="d-activated"
                if self.keys_pressed["right"] else "d",
                x=224,
                y=180,
                camera=camera)
            drawText(self.screen,
                     text="alternative",
                     x=120,
                     y=250,
                     font_size=36)
            self.keys_sprite_sheet.drawTexture(
                texture_name="left-activated"
                if self.keys_pressed["left"] else "left",
                x=140,
                y=290,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="right-activated"
                if self.keys_pressed["right"] else "right",
                x=224,
                y=290,
                camera=camera)

            drawText(self.screen, text="Jump:", x=540, y=100, font_size=64)
            self.keys_sprite_sheet.drawTexture(
                texture_name="space1-activated"
                if self.keys_pressed["jump"] else "space1",
                x=500,
                y=180,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="space2-activated"
                if self.keys_pressed["jump"] else "space2",
                x=584,
                y=180,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="space3-activated"
                if self.keys_pressed["jump"] else "space3",
                x=668,
                y=180,
                camera=camera)
            drawText(self.screen,
                     text="alternative",
                     x=520,
                     y=250,
                     font_size=36)
            self.keys_sprite_sheet.drawTexture(
                texture_name="w-activated"
                if self.keys_pressed["jump"] else "w",
                x=540,
                y=290,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="up-activated"
                if self.keys_pressed["jump"] else "up",
                x=624,
                y=290,
                camera=camera)

            drawText(self.screen, text="Pause:", x=950, y=100, font_size=64)
            self.keys_sprite_sheet.drawTexture(
                texture_name="esc-activated"
                if self.keys_pressed["pause"] else "esc",
                x=1000,
                y=180,
                camera=camera)
            drawText(self.screen,
                     text="alternative",
                     x=940,
                     y=250,
                     font_size=36)
            self.keys_sprite_sheet.drawTexture(
                texture_name="p-activated"
                if self.keys_pressed["pause"] else "p",
                x=1000,
                y=290,
                camera=camera)
        # Messages for second tutorial
        elif self.level["id"] == 1:
            drawText(self.screen,
                     text="Color change:",
                     x=160,
                     y=100,
                     font_size=64)
            self.keys_sprite_sheet.drawTexture(
                texture_name="1-activated" if self.keys_pressed["1"] else "1",
                x=250,
                y=180,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="2-activated" if self.keys_pressed["2"] else "2",
                x=334,
                y=180,
                camera=camera)
            self.keys_sprite_sheet.drawTexture(
                texture_name="3-activated" if self.keys_pressed["3"] else "3",
                x=418,
                y=180,
                camera=camera)
            drawText(self.screen, text="Finish -", x=1090, y=550, font_size=36)
        # Messages for third tutorial
        elif self.level["id"] == 2:
            drawTextCentered(self.screen,
                             text="Reach the coin!",
                             y=100,
                             font_size=64)
Пример #10
0
 def drawPauseMessage(self):
     drawTextCentered(self.pause_surface,
                      text="PAUSED",
                      y=200,
                      font_size=96)