I want to create a text based game, where the player will type up,down, left or right and the sprite will move in that direction. I created the game and at the moment the player moves with the up,left,down and right keys. I would like to change the movement of the sprite from keypresses to text commands, Ive googled a lot on creating text based games in XNA but have had no luck. Could you please help me or guide me in the right direction of how to do this in XNA.
If your goal is a text based game your better off making it with regular Form based program, or my favourite WPF. XNA has no built in support for handling typing, that is, quick presses of keys in sequence. It focuses entirely on detecting keys being held over time (which is more likely the case in an action style game). If you really need XNA to display the results as sprites you need to hook into the keyboard events, I would consider WPF some more however if you want a text adventure.
If you really want to use XNA and graphics along with your text adventure, you should build your own interface; this should be the least of your challenges since you already seem to know how to display and manipulate graphics with XNA.
The question is, do you want to write a text adventure, or a text adventure engine?
If what you really want is to write a text adventure, you probably should not start by writing a whole new engine. That would be like building your own car if all you want is driving a car.
Writing your own text adventure engine first would not be trivial,I imagine. I would recommend you first try whether an existing engine suits your needs. At least one of those seems to support at least still images for illustration, so they are not text only, which you seem to go for. If you have gathered enough experience with existing systems, you could still write your own engine.
Also highly relevant: this Q&A on Stack Overflow
I haven't used XNA, but I have done this at a game jam.
I extended a text box class from an open source GUI library. Whenever the user pressed enter, it cleared the box, checked for a certain keyword/command, and did stuff.
It seems like you can either wrap a XNA game in a WinForm or WPF. If not, there are a few open source GUIs out there.
Possibly helpful question: