Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7777151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:03:55+00:00 2026-06-01T18:03:55+00:00

I am trying to create a simple application, really simple. I don’t know why,

  • 0

I am trying to create a simple application, really simple.

I don’t know why, but when I click the left arrow, or the right one, the texture doesn’t change it position.

I am sure I’m missing something, can’t figure what, gonna look stupid.

main file: http://paste.ubuntu.com/919662/

Character.cs: http://paste.ubuntu.com/919664/

Position.cs: http://paste.ubuntu.com/919665/

Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:03:56+00:00Added an answer on June 1, 2026 at 6:03 pm

    UPDATED ANSWER:

    The real culprit is:

    KeyboardState Keyboard = new KeyboardState();

    You cannot use ‘Keyboard’ as a variable name. It’s a class from XNA! You are redeclaring it. Hence, your key presses are no longer being detected! Use this instead:

    KeyboardState keyb = Keyboard.GetState();
    

    And update your references

    This answer is somewhat valid:

    You are initializing Character

            C = new Character(100, 100, new Position(200, 200));
    

    But then in your Update() method you do:

            spriteBatch.Draw(myTexture, myVector, Color.White);
    

    You are properly modifying the value of Pos in the Character class, but that is in no way associated with myTexture. In fact, you are not even drawing “Character” on the screen at all.

    TL;DR: You are modyfing the “Character” class, but you are drawing myTexture. You are modify the coordinates on the object that holds myTexture, not Character.

    Additionally, if you want to draw “Character” on screen, the best way would be just use Vector2D instead of your own Pos class.

    One more thing:

    In LoadContent you are doing

            myVector = new Vector2(C.Pos.Col, C.Pos.Row);
    

    But the documentation clearly states:
    /// LoadContent will be called once per game and is the place to load
    /// all of your content.

    That should get you started on how to fix it up. If you still have questions, just post a comment under my answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a very simple chat application in Flex/.Net using FluorineFX but
I am trying to create this simple application in c#: when the user double
I'm trying to create a simple Silverlight application that involves parsing a CSV file
I am trying to create a simple Android application that has a ActivityList of
Im trying to create a simple pan and zoom app using silverlight 4, but
Im trying to create a simple input box with form validation, but im not
I'm trying to create a simple OCR application with SVM, openCV, C++ and Visual
I'm trying to create a really simple to do list using an array and
I'm am trying to create a very simple WCF client application which will send
I'm trying to create a very simple WPF application. I'd like to have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.