Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dandy Masher

Pages: [1]
1
General Discussion / (no subject)
« on: June 07, 2005, 07:55:31 PM »
Hey, could someone help me with this?  This is a very basic type of menu I used in TK2, but it doesn't want to work in TK3.  I'd really appreciate if someone could give it a quick gander.

The problem is that my While loop doesn't seem to be properly detecting my keypress.  No matter which key I press, the game locks up.

Code: [Select]
// menu display program

done! = false
button! = 1
mainMenuImage()
while (!done!)
{
   wait(result$)
   if (result$ == "UP")
   {
      button! = button! - 1
      if (button! < 1)
      {
         button! = 1
      }
      mainMenuImage()
   {
   if (result$ == "DOWN")
   {
      button! = button! + 1
      if (button! > 9)
      {
         button! = 9
      }
      mainMenuImage()
   {
   if (result$ == "X")
   {
      delay(0.25)
      fade(2)
      fontSize(20)
      done! = true
   }
}

And here is the method referenced above.

Code: [Select]
// mainMenuImage method

method mainMenuImage()
{
   if (button! == 1)
      {
      setImage("menu_main_items.png", 328, 16, 296, 192)
      }
   if (button! == 2)
      {
      setImage("menu_main_gear.png", 328, 16, 296, 192)
      }
   if (button! == 3)
      {
      setImage("menu_main_talents.png", 328, 16, 296, 192)
      }
   if (button! == 4)
      {
      setImage("menu_main_status.png", 328, 16, 296, 192)
      }
   if (button! == 5)
      {
      setImage("menu_main_roster.png", 328, 16, 296, 192)
      }
   if (button! == 6)
      {
      setImage("menu_main_map.png", 328, 16, 296, 192)
      }
   if (button! == 7)
      {
      setImage("menu_main_load.png", 328, 16, 296, 192)
      }
   if (button! == 8)
      {
      setImage("menu_main_return.png", 328, 16, 296, 192)
      }
   if(button! == 9)
      {
      setImage("menu_main_exit.png", 328, 16, 296, 192)
      }
}

Thanks for looking.

DM

Pages: [1]