How do I make a character move around ina box using c#orC++?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Levio91
Chaos Rift Regular
Chaos Rift Regular
Posts: 119
Joined: Thu Nov 06, 2008 9:50 pm

How do I make a character move around ina box using c#orC++?

Post by Levio91 »

I want a character (letter A) to move around in a dos type box roughly 10x10 characters long. Will someone write me a quick program so I can look at it? It should be kind of like the game rogue.

Image
"Criticism is something you can avoid easily by saying nothing, doing nothing, and being nothing. " - Aristotle

http://www.facebook.com/profile.php?id= ... ef=profile
Image
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: How do I make a character move around ina box using c#orC++?

Post by MarauderIIC »

Well, it depends. Some compilers (Borland, for instance) offer compiler-specific functions to place something at a certain x, y on the console. Otherwise, if you want smooth movement (not whole screen cls & redraw), you might have to roll your own, I'm not sure.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: How do I make a character move around ina box using c#orC++?

Post by andrew »

Go here and download the code from the post titled "Text Console Library."

There's a simple demo game with it. It should be what you're looking for. :)
Post Reply