def __init__(self): self.scroll = 0 self.player = Player(WIN_WIDTH / 2, 360) self.items = [Chest(WIN_WIDTH / 2 + 540, 310, 'images/case.png', "Сейф 1", 320 // 4, 240 // 3), Picture(WIN_WIDTH / 2 - 150, 240, 'images/picture.png', "Картина", 320 // 4, 240 // 3), Books(WIN_WIDTH / 2 + 200, 300, 'images/books.png', "Книги",320 // 2, 240 // 2), Jail(WIN_WIDTH / 2 + 750, 269, 'images/jail.png', "Заключенный", 320, 240), Table(WIN_WIDTH / 2 - 300, 300, 'images/table.png', "Стол", 320 // 2, 240 // 2)] self.dialog = Dialog("- Добро пожаловать в мир твоих самых страшных кошмаров, жалкий офисный червяк.") self.left = self.right = self.up = self.down = False
def start(self): pygame.init() pygame.joystick.init() self.font = pygame.font.Font(None, 24) self.running = True self.initDisplay() self.table = Table() self.consoleThread = Thread(target=self.startInteractiveShell) self.consoleThread.setDaemon(True) self.consoleThread.start() time.sleep(0.1) self.loop()
def __init__(self, game): super().__init__(game) self.table = Table(game) self.gomenu = False self.objects.append( ButtonObject(self.game, self.game.width - 150, self.game.height - 100, 100, 50, RED, self.go_menu, text='MENU')) self.text = TextObject(self.game, self.game.width // 2, self.game.height // 5, self.get_gameover_text_formatted(), (255, 255, 255)) self.objects.append(self.text) self.objects.append(self.table)