def show(self): bgc = (105, 175, 205) sa_menu.show_Zone(bgc, 380, 350, 250, 150) sa_menu.show_Text('MONSTER:' + self.name, 370, 400, (200, 200, 200), 200) sa_menu.show_Text('HP', 400, 400) sa_menu.show_Text('LV', 400, 440) sa_menu.show_Text(str(self.hp), 430, 400) sa_menu.show_Text(str(self.level), 430, 440) pygame.display.update() return
def main(): pygame.init() display_width = 800 display_height = 600 winDisplay = pygame.display.set_mode((display_width, display_height)) pygame.display.set_caption('simple Arena') Font = pygame.font.Font(None, 26) white = (205, 205, 205) bgc = (105, 175, 205) winDisplay.fill(white) clock = pygame.time.Clock() sa_menu.set_Display(winDisplay, clock, Font) turn = 0 i = (0, '?') global n n = 0 global h h = New() global dead dead = 0 global listm listm = [] MENU = ['New', 'Load', 'Save', 'Display', 'Fight', 'Quit'] CMD = [New, Load, Save, Display, Fight, Quit] while i[1] != ('Quit'): h.show() i = sa_menu.menu_loop(MENU) CMD[i[0]]() if (h.live == False): n += 1 h = New() turn += 1 sa_menu.show_Text('Turn' + str(turn), 100, 400) j = 0 #sa_menu.show_Zone(white,50,200,250,225 )# sa_menu.show_Zone(bgc,380,350,250,150) pygame.display.update() for rx in listm: sa_menu.show_Text(rx, y=200 + (25 * j), x=55) j += 1 if j > 8: j = 0 listm = [] sa_menu.show_Zone( white, 50, 200, 250, 225) # sa_menu.show_Zone(bgc,380,350,250,150) pygame.display.update() pygame.quit() quit() return
def show(self): bgc = (105, 175, 205) sa_menu.show_Zone(bgc, 380, 150, 250, 150) sa_menu.show_Text('NAME:' + self.name, 170, 400, (200, 200, 200), 200) sa_menu.show_Text('HP', 200, 400) sa_menu.show_Text('LV', 200, 440) sa_menu.show_Text('XP', 200, 480) sa_menu.show_Text(str(self.hp), 230, 400) sa_menu.show_Text(str(self.level), 230, 440) sa_menu.show_Text(str(self.xp), 230, 480) pygame.display.update() return
def damage(self): d = (5, 6, 7) dmg = random.choice(d) * (self.level + 1) sa_menu.show_Text('D:' + str(dmg), 260, 400) pygame.display.update() return dmg