Jump to content
  • Advertisement
Sign in to follow this  
XDaWNeDX

moving cursor in consol applications

This topic is 2547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Yes, it's c++.

How would I use those console functions? I've already seen them but I have no clue how to use them properly. I suppose I'll just make a test application and see if I can't make it work somehow.

Share this post


Link to post
Share on other sites
[source lang="c++"]
void f()
{
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);

COORD c;
c.X=19;
c.Y=8;

SetConsoleCursorPosition(out,c);
}
[/source]

Simples. :)

Share this post


Link to post
Share on other sites

[source lang="c++"]
void f()
{
HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);

COORD c;
c.X=19;
c.Y=8;

SetConsoleCursorPosition(out,c);
}
[/source]

Simples. :)



Mmk, thanks SOOO much.

I'm trying to make an RPG with moving characters and stuff in a console application. But whenever you push the up/left/down/right buttons the WHOLE screen re-writes itself which makes it kinda bleh...

Share this post


Link to post
Share on other sites
You can find some decent (but not excellent!) examples of using the Windows console API here. The code was written in 3 hours so be warned, it isn't hugely pretty or necessarily the best example of how to do certain things. But it should at least get you started and give you a rough idea of how things could be done.

Share this post


Link to post
Share on other sites

You can find some decent (but not excellent!) examples of using the Windows console API here. The code was written in 3 hours so be warned, it isn't hugely pretty or necessarily the best example of how to do certain things. But it should at least get you started and give you a rough idea of how things could be done.



Mm, yes, well what I currently have is as follows:
http://www.barnumize...lease0.01.5.rar
(up/down/right/left to move, space for pause menu/select)
Removed the AI because I'm doing other stuff right now, and when I'm testing it the monsters keep attacking me. D: Plus, all it really did was make them walk into walls.
That's basically MOST of my game. I HAVE made other updates since uploading it to my website though.

Although, what you've shown me has different colours, so I'll download it..
That's too in depth for me. Surely I could use it, and really make my game look good. But if I wanted to do that, I'd use allegro, or directx, or some form of graphics API.
The point of my game is to make it as simple as possible.
Using what Aardvajk told me. Thanks again Aardvajk!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!