View Full Version : Rotation Menu
kingofnukes
February 13th, 2007, 08:15 PM
Hi, I've made a 3d menu that rotates on arrow key down, but I want to set it to only go to the next item instead of it moving constantly if the key is down.
basically: 1 press = one character rotation increment.
I've attached my source. :thumb:
DangerousDan
February 14th, 2007, 06:11 PM
2 Options I think of:
Set a variable on keyDown and check that variable every keyDown, if it is true then do nothing on the keyDown. On keyUp make the variable false again.
OR
Just make the increment on KeyUp.
I'm sorry if I misunderstood your problem but I'm in a rush. :hugegrin:
kingofnukes
February 14th, 2007, 08:19 PM
I don't get your first statement. And as for the second...
Its an arrow key so i cannot do onRelease but good idea.
DangerousDan
February 14th, 2007, 08:39 PM
I'll have some code up in a second...
EDIT: Here's what I came up with really fast, I'm sure there's a better way...
released = true;
if(Key.isDown(Key.LEFT))
{
if(released)
{
rotateCharacter(); //replace this with character or menu rotation
released = false;
}
}
else if(!Key.isDown(Key.LEFT) && !released) //Down key isn't pressed
{
released = true;
}
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.