def CharCreation(): Con = 5; Agi = 5; Pwr = 5; Stg = 5; Itl = 5; free_points = 20 while 1: gui.win.setscreencolors(None, None, True) gui.win.putchars('New Character', 0, 0, fgcolor=pygame.Color(255,255,255)) # Con Agi Pwr Stg Itl # options = ['Constitution:', 'Agility:', 'Power:', 'Strength:', 'Intelligence:'] gui.menu([gui.header('Base Skills:', pygame.Color(170, 170, 170))], options, 3, width=0) gui.win.putchars('Press the letter to increment; Press SHIFT + the letter to decrement.', 0, gui.WIN_HEIGHT - 2, pygame.Color(170, 170, 170)) gui.win.putchars('Press \'>\' to continue', 0, gui.WIN_HEIGHT - 1, pygame.Color(0,0,255)) gui.win.putchars('Free Skill Points Remaining: ' + str(free_points), gui.WIN_WIDTH // 2, 3, pygame.Color(0,170,0)) gui.win.putchars(str(Con), 25, 6) gui.win.putchars(str(Agi), 25, 7) gui.win.putchars(str(Pwr), 25, 8) gui.win.putchars(str(Stg), 25, 9) gui.win.putchars(str(Itl), 25, 10) gui.win.update() gui.win.blittowindow() choice = handle_keys() if choice == 'a' and free_points > 0: Con += 1 free_points -= 1 elif choice == 'b' and free_points > 0: Agi += 1 free_points -= 1 elif choice == 'c' and free_points > 0: Pwr += 1 free_points -= 1 elif choice == 'd' and free_points > 0: Stg += 1 free_points -= 1 elif choice == 'e' and free_points > 0: Itl += 1 free_points -= 1 elif choice == 'A' and Con > 5: Con -= 1 free_points += 1 elif choice == 'B' and Agi > 5: Agi -= 1 free_points += 1 elif choice == 'C' and Pwr > 5: Pwr -= 1 free_points += 1 elif choice == 'D' and Stg > 5: Stg -= 1 free_points += 1 elif choice == 'E' and Itl > 5: Itl -= 1 free_points += 1 elif choice == '>': gen.player_cognitive = ait.Cognitive(Con, Agi, Pwr, Stg, Itl) gui.win.setscreencolors(None, None, True) ait.game_state = 'normal' game = Game()
def MainMenu(): while 1: ait.game_state = 'menu' gui.win.setscreencolors(None, None, True) options = ['Start New Game'] headers = [gui.header('XTRICATE OUTLAST: A zombie apocalypse roguelike', pygame.Color(255,0,0)), gui.header('By Alasdair McLean', pygame.Color(170,170,170))] gui.menu(headers, options, gui.WIN_HEIGHT // 3) # gui.win.putchars('XTRICATE OUTLAST: A zombie apocalypse roguelike', (gui.WIN_WIDTH // 2) - 23, gui.WIN_HEIGHT // 3, pygame.Color(255,0,0)) # gui.win.putchars('By Alasdair McLean', (gui.WIN_WIDTH // 2) - 7, (gui.WIN_HEIGHT // 3) + 1, pygame.Color(255,255,255)) # gui.win.putchars('1) Start New Game', (gui.WIN_WIDTH // 2) - 6, (gui.WIN_HEIGHT // 3) + 3, pygame.Color(150,150,150)) gui.win.update() gui.win.blittowindow() choice = handle_keys() if choice == 'a': gui.win.setscreencolors(None, None, True) CharCreation()