Author Topic: (no subject)  (Read 1734 times)

Dandy Masher

  • Member
  • *
  • Posts: 1
    • View Profile
(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
« Last Edit: December 31, 1969, 06:00:00 PM by Dandy Masher »
Eating babies since 1729.

Aminaga

  • Member
  • *
  • Posts: 1665
    • View Profile
    • http://ultimategamingproductions.net
(no subject)
« Reply #1 on: June 08, 2005, 06:05:45 AM »
Just so you know, the name DM is taken.  Razz
« Last Edit: December 31, 1969, 06:00:00 PM by Aminaga »
<span style=\'font-size:16pt;line-height:100%\'><a href=\'http://ultimategamingproductions.net\' target=\'_blank\'>WWW.ULTIMATEGAMINGPRODUCTIONS.NET</a></span>

AlienDude

  • Member
  • *
  • Posts: 605
    • View Profile
    • http://www.taralax.com
(no subject)
« Reply #2 on: June 08, 2005, 08:32:33 AM »
Look at my menu help topic at the bottom, i have a menu system similar to yours, i use canvases, which is the new way of doing things.

And allyou have in the if array(yu can use switch() now) is put images up, not actually DO anything, or allow to do anything, just stare at the pretty pictures.  Take a look at canvassing!

change the wait() command to result$=wait().

(Also you could have called yourself Master Shake Smile ) that way yor initials would be MS!!! Laughing
« Last Edit: June 08, 2005, 08:48:56 AM by AlienDude »
Quote
May your star always be good to you and may your travels be swift.
 
- Traveller Farewell
(adapted from the Necroscope series by Brian Lumley)

Taralax Studios BEING REBUILT GENOME BY GENOME! Razz


By me. But I don't give a rat's ass who gets called DM. I prefer to be called Dude Man anyways.  <_<
« Last Edit: June 08, 2005, 09:41:55 PM by Dude Man »
~Welcome back mysticsoftware.net??
The Black Walkway

Xorlak

  • Administrator
  • Member
  • *****
  • Posts: 2225
    • View Profile
    • http://darkagegames.net
(no subject)
« Reply #5 on: June 11, 2005, 04:47:48 PM »
Sorry it took so long.  Just be careful with your braces... (Heh...)

Code: [Select]
done! = false
button! = 1
mainMenuImage()
while (!done!)
{
  wait(result)
  if (result == "UP")
  {
     button! = button! - 1
     if (button! < 1)
     {
        button! = 1
     }
     mainMenuImage()
  }                               // <-- This brace was flipped!
  if (result == "DOWN")
  {
     button! = button! + 1
     if (button! > 9)
     {
        button! = 9
     }
     mainMenuImage()
  }                               //  <-- This too!
  if (result == "X")
  {
     delay(0.25)
     fade(2)
     fontSize(20)
     done! = true
  }
}
« Last Edit: June 11, 2005, 04:48:22 PM by Xorlak »

Aminaga

  • Member
  • *
  • Posts: 1665
    • View Profile
    • http://ultimategamingproductions.net
(no subject)
« Reply #6 on: June 11, 2005, 04:48:31 PM »
Eh, I don't see any braces through that helmet of yours. J/K
« Last Edit: June 11, 2005, 04:48:41 PM by Aminaga »
<span style=\'font-size:16pt;line-height:100%\'><a href=\'http://ultimategamingproductions.net\' target=\'_blank\'>WWW.ULTIMATEGAMINGPRODUCTIONS.NET</a></span>