View Single Post
Old 02-17-2007, 02:00 PM   #1 (permalink)
Storm33229
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default Switching Keyboard Input

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;
        }
Error:
Code:
'Microsoft.Xna.Framework.Input.Keys' is a 'type' but is used like a 'variable'
I can't stand using if/else statements when I have the ability to use a switch...so...any ideas? or is this even possible?
__________________
Quote:
Originally Posted by Radwen
You should crush your pills and sniff them.
Storm33229 is offline   Reply With Quote