• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About Hasenj

  • Rank
  1. Using Keyboard in C#

    okay sounds good, will do it. thx again :)
  2. Using Keyboard in C#

    Hi,   I tried and now it works.. but I didn't know why is now working.. I can't reproduce it :-(  I need definitly work with different versions if something is not working..       No I didn't know.. as I said.. I'm absolute novice.. I don't have any programming skills.. It's my first try.. (in my past I did work with HTML & CSS, but this is anything else but not a programming language..)   Thank you very much for all the responses..  best-
  3. Using Keyboard in C#

    just at the beginning of the game in  public class Game1 : Microsoft.Xna.Framework.Game { some stuff.. Vector2 ringsPosition = Vector2.Zero; }
  4. Using Keyboard in C#

    Hi,   I'm new on this forum and after reading a while I decided to start. I choose as environment Visual Studio Express 2010 with C# and XNA 4.0, because I thought it's well documented to get better tutorials and so on.   I have no programming skills. I have some ressources like microsoft forum and some ebooks like O'Reillys "Learning XNA 4.0".   my question is.. to learn the first steps I would try to work with 2d sprites.   I have a KeyboardState and my sprite is showing and it works but if I want to use my keyboards, nothing happens.   I write this code in the Update method:   // this 2 lines are in my class game Vector2 ringsPosition = Vector2.Zero; const float ringsSpeed = 6; // this move threerings based on keyboard input are in my update method KeyboardState keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyDown(Keys.Left)) ringsPosition.X -= ringsSpeed; if (keyboardState.IsKeyDown(Keys.Right)) ringsPosition.X += ringsSpeed; if (keyboardState.IsKeyDown(Keys.Up)) ringsPosition.Y -= ringsSpeed; if (keyboardState.IsKeyDown(Keys.Down)) ringsPosition.Y += ringsSpeed;   The Microsoft.XNA.Framework.Input is in using and works. If I start to debug and test, my sprites are animated but nothing happend if I use my keyboard.   any ideas? Or did you need the complete code to check what I'm doing wrong? thanks.