Dark Age Games
Home Dark Age EX Dark Age 2 Message Board Fan Art FAQ Kelzar Mage DALpedia MS Forum
Board Index Dark Age General Bug Report Website Off Topic Register User Edit User User List Search

In reply to: Battle System Question -- Aminaga 12:48:28 09-11-2005

Well...
Posted by: Xorlak
12:28:55 09-12-2005

I usually do something like this:


selection! = 1 // First menu item
ypos! = 100 // Y position of first menu item
done! = 0
while(done! == 0)
{
  setimagetransparent("cursor.gif",100,ypos!,10,10,255,255,255)
  wait(a$)
  if(a$ == "UP")
  {
    // Go up one menu item
    selection! = selection! - 1
    ypos! = ypos! - 15
  }
  if(a$ == "DOWN")
  {
    // Go down one menu item
    selection! = selection! + 1
    ypos! = ypos! + 15
  }
  // Wrap around if necessary
  if(selection! <= 0)
  {
    selection! = 5  // last menu item
    ypos! = 160
  }
  if(selection! > 5)
  {
    selection! = 1  // first menu item
    ypos! = 100
  }
  if(a$ == " ") // SPACE, or whatever your confirm key is
  {
    done! = 1
    // At this point 'selection!' is the number of the menu item chosen
    // You can return it, etc.
  }
}


And yeah, I guess cheese is okay... (Heh...)

----------
-Xorlak
Edit Post