Sign in to follow this  

keeping something on screen

This topic is 4308 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

I am just working on my basic text based game in simple C++ format. I am just wondering if there is anyway to keep something displayed on the like the top of the screen or the bottom as the text will roll. I am thinking of having the character name and health displayed at all times. also whats the command to clear the screen? thanks.

Share this post


Link to post
Share on other sites
Well, maybe you could make a function that will use 1 or 2 line at the top of the console that write the name and what you need. It would be called before you draw your map or what you usualy draw.

to clear the screen use : system("cls");

Share this post


Link to post
Share on other sites
First off, Google is your friend.

Second, you can clear the console in C++ by this:

#include <cstdlib>

std::system("Cls");

About the constant display, I dunno off the top of my head. If you do some googling, you're bound to found out how, and find some open-source apps that have done the same thing.

Best of luck.

[EDIT]
Beat to the draw

Share this post


Link to post
Share on other sites
Quote:
Original post by ricekrispyw
First off, Google is your friend.



It's the Beginner's forum. Don't beat people over the head with worthless "Google it yourself" answers.

First, the whole point of asking for help here is to get expert advice directly from people who are willing to help. Google completely removes any personal involvement. What is the point in even having a discussion forum if everyone thinks that using a search engine is better than discussing?

Google can't discuss... Google can't teach.

Second, not everyone knows enough to even know what to search for in the first place. Hence, the BEGINNER'S FORUM. How would a beginner even know what to Google anyways?

Share this post


Link to post
Share on other sites
I'm a newbie myself, and haven't gone through the files, but Angband is a console based adventure game which has freely available source code. If you have the patience, you can muddle through those files to find out how they did it. From what I have looked at, it looks very well documented.

linky

and go to the downloads tab. Source code is near the bottom of the page.

Share this post


Link to post
Share on other sites
if your compiler supports it( just try it to see) you can use conio.h for some useful functions like:

clrscr() //clears screen
gotoxy(int x, int y) // puts cursor at xy

if you use dev-cpp you can get a cool version of it in and easy to use devpak from
http://conio.sourceforge.net/

good luck, happy coding!

Share this post


Link to post
Share on other sites

This topic is 4308 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this