|
||
|
|
#1 (permalink) | |
|
Forum Expert
|
I'm trying to make a switch statement for keyboard input:
Code:
switch (newState.IsKeyDown(Keys))
{
case Keys.Up: spritePosition.Y++; break;
case Keys.Down: spritePosition.Y--; break;
case Keys.Right: spritePosition.X++; break;
case Keys.Left: spritePosition.X--; break;
}
Code:
'Microsoft.Xna.Framework.Input.Keys' is a 'type' but is used like a 'variable'
__________________
Quote:
|
|
|
|
|
|
|
#2 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,762
|
IsKeyDown sounds like it should return boolean not the keys that are down....
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|