Re: I need help, again!

I do. I have the Tolk files in there. Thing is, the Tolk works in the main file, and in the menu file if I add it to any other function but run. When I add it to run function, the program crashes, though it does the same without it, as well. My code is short, and I really think that something's is wrong with my run function. It's in the link in my last post of the thread, but I'll post the code in here, as well.

 def run(self, Tolk):
  choice = 0
  if len(self.menu_choices)==0:
   return -2
  Tolk.output(str(self.menu_choices.get(choice)), True)
  for event in pygame.event.get():
   if event.type == KEYDOWN:
    if event.key == K_UP and choice>0:
     choice-=1
     Tolk.output(str(self.menu_choices.get(choice)), True)
    elif event.key == K_DOWN and choice<len(self.menu_choices)-1:
     choice+=1
     Tolk.output(str(self.menu_choices.get(choice)), True)
   pygame.event.pump()

  If anybody could shed some light on here I'd be extremely grateful.
Also, you may ask me how am I sure that the bug is in the run function? It's simple. I tested out every other function, passing Tolk as it's params, and it worked like a charm. I think my issue is not with Tolk, but with pygame itself. I wouldn't be surprised if it's a simple matter of capitalization.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : The Dwarfer via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector

Reply via email to