python 2.7 - My code will run without errors but it will not display -


i trying create menu game i'm doing , code menu, when run it, won't display window.

can me find error can display menu window?

this code:

import pygame pygame.locals import *

class menu:

def __init__(self, options):     self.options = options     self.font = pygame.font.font("dejavu.ttf", 20)     self.select = 0     self.total = len(self.options)     self.keep_pressing = false  def update(self):      k = pygame.key.get_pressed()      if not self.keep_pressing:         if k[k_up]:             self.select -= 1         elif k[k_down]:             self.select += 1         elif k[k_return]:             title, function = self.options[self.select]             print "opciones"%(title)             function()      if self.select < 0:         self.select = 0     elif self.select > self.total -1:         self.select = self.total -1      self.keep_pressing = k[k_up] or k[k_down]  def texto(self, screen):      total = self.total     indice = 0     option_height = 25     x=100     y=100      (title, function) in self.options:         if indice == self.select:             color = (0, 200, 0)         else:             color = (0, 0, 0)          image = self.font.render(title, 1, color)         position = (x, y + option_height * indice)         indice += 1         screen.blit(image, position)    def opcion_1():     print "opcion 1" def opcion_2():     print "opcion 2" def opcion_3():     print "opcion 3" def opcion_4():     print "opcion 4"    if __name__ == '_main_':      finish = false     options = [         ("opcion 1"),         ("opcion 2"),         ("opcion 3"),         ("opcion 4")         ]      pygame.font.init()     screen = pygame.display.set_mode((400, 400))     background = pygame.image.load("negro.jpeg").convert()     menu = menu(options)      while not finish:         e in pygame.event.get():             if e.type == quit:                 finish = true         screen.blit(background, (0, 0))         menu.update()         menu.texto(screen)          pygame.display.flip()         pygame.time.delay(10) 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -