def control_dialogue(self, keys, current_time):
        self.dialogue_box = self.make_dialogue_box(self.dialogue, self.index)

        if self.index < (len(self.dialogue) - 1) and self.allow_input:
            if keys[pg.K_SPACE]:
                self.index += 1
                self.allow_input = False

                if self.index == (len(self.dialogue) - 1):
                    self.state = self.begin_new_transaction()
                self.notify(c.CLICK2)

        if not keys[pg.K_SPACE]:
            self.allow_input = True
Control the dialogue boxes
dataset/ETHPy150Open justinmeister/The-Stolen-Crown-RPG/data/shopgui.py/Gui.control_dialogue