Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.img = c.IMG("blackbox.png")
        self.box = c.SPRITE(self.img, x=370, y=250)
        self.box.scale = 3
        self.center_x = (self.img.width // 2) + self.box.x
        self.center_y = (self.img.height // 2) + self.box.y
        self.showing = False
        self.decided = False
        self.letters = []
        self.letter_scale = 3
        self.coords = {}
        self.question = c.LABEL(font_name=c.FONT,
                                x=self.center_x,
                                y=self.center_y,
                                font_size=24,
                                width=self.box.width,
                                batch=c.PROBLEM_BATCH)
        self.x_offset = 40

        #setup alphabet image indices
        for letter in enumerate(lowercase):
            self.coords[letter[1]] = letter[0] * 8
        for letter in enumerate(uppercase):
            self.coords[letter[1]] = letter[0] * 8
Exemplo n.º 2
0
    def __init__(self):
        self.title = c.SPRITE(c.IMG("title.png"))
        self.title.scale = 2
        self.label_x_offset = 20
        self.title.x = (c.GAME_WINDOW.width - self.title.width) / 2
        self.title.y = (c.GAME_WINDOW.height - self.title.height) / 2

        self.subtitle = c.SPRITE(c.IMG("quizlabel2.png"))
        self.subtitle.x = (c.GAME_WINDOW.width - self.subtitle.width) / 2
        self.subtitle.y = (c.GAME_WINDOW.height -
                           self.subtitle.height) / 2 - 100

        self.title_background = c.SPRITE(c.IMG("titlebackground.png"))
        self.title.ground = c.SPRITE(c.IMG("titleground.png"))

        #BUTTONS
        self.label_center = 450  #xpos of buttons, i becomes ypos
        self.coords = [
            Coord(self.label_center, i) for i in range(120, 60, -30)
        ]
        self.coords.reverse()

        self.options_button = c.LABEL("Options",
                                      font_size=c.FONT_SIZE,
                                      color=c.BLACK,
                                      bold=True)
        self.options_button.x = self.coords[0].x + self.label_x_offset
        self.options_button.y = self.coords[0].y

        self.game_button = c.LABEL("Game",
                                   font_size=c.FONT_SIZE,
                                   color=c.BLACK,
                                   bold=True)
        self.game_button.x = self.coords[1].x + self.label_x_offset
        self.game_button.y = self.coords[1].y

        self.vertical_index = 0
        self.selector = s.Selector(self.coords)
Exemplo n.º 3
0
 def __init__(self, player, *args, **kwargs):
     super().__init__(player.left_anim, *args, **kwargs)
     self.y = c.SCORE_SPRITE_Y
     self.batch = c.SCORE_BATCH
     self.player = player
     self.value = 0
     self.scale = 1.5
     if isinstance(player, BigBoo):
         self.scale = 1
     self.number = c.LABEL(text=str(self.value),
                           y=self.y + c.POINT_Y_OFFSET,
                           font_name=c.FONT,
                           font_size=c.FONT_SIZE,
                           batch=c.SCORE_BATCH)