New to C++ (<3 months of EXP) need help with RPG

I wanted to know if there's a simple way to constantly have a status bar constantly displaying at the bottom of the console window. I want it to display some useful information such as hitpoints, and character status (low health, poisoned, etc).
http://i.imgur.com/RBJ0D.png
sorry if the question isn't very clear enough or is too amateur.


I should also mention this is a text based RPG
Last edited on
There is a way to do it, some guidelines are here:
http://cplusplus.com/articles/4z18T05o/
Or if you use Windows, you can use the class i uploaded few minutes ago, description here: http://cplusplus.com/forum/lounge/65208/
Last edited on
hmm i'll look into it. Also, is there a way I could create a function that I can call whenever that will print a series of outputs?

ex: void status();

output:

cout << a << endl;
cout << b << endl;
cout << c << endl;
Yes, you can create a new function like this:
1
2
3
(type) (functionname) (parameters) {
    (code);
}

Like...
1
2
3
4
void Status() {
 cout << a << endl;
 ...
}

Just make sure you don't declare the a variable in your main() function, but before both functions, and declare your main function after the new functions.
So how would I make it so the function Status(); is always being displayed at the top of the console and clearscreen only affects everything below it?
You don't. If you need this kind of behavior it is time to move away from the console. The console is not meant for these types of things. You will be pulling your hair out working with games in the console, while you could be drinking lemonade selling your windowed game ;)
@LB

http://pastebin.com/TayZ40Bw

From the looks of what I have so far you think having a 'windowed' game is right for me? :p
If you plan on using at least a couple days, you can start creating windowed games. This project took me a week, around 8 days: http://localhostr.com/file/yg4Tcvz/BattleTanks.rar
(First create a map, in the editor press H for commands)
(There are 2 main layers: Front and Back. Front overrides tanks, Back is behind them)
@Ess

I dont understand what I'm even looking at, I'll press Single Player and it asks me to open a file :s
(First create a map, in the editor press H for commands)
You must create a map with the editor, and save it.
Oh yeah, I probably should've mentioned from the start that this is a Dungeon Crawl type of game.. or text based RPG
@Ess

When I go to load the map, the files don't appear
rename your file and add the .btm extension
ahh I got it to work now. but anyways, I wasnt really thinking about making a windowed game.. i was more into the idea of a text based RPG
you can still do it. With my class (link at 1st post) you can use console->write and console->setpositiontext that will be useful for position-based text.
I honestly have no understanding of your class :s
I'm taking classes at my highschool, so not neccesarily learning a ton of useful stuff, just basics:

(all using namespace std;)
loops (sentinel, flag, do, for, while, counter)
if/nested if statements
switch()
all variable types
type casting
some work with conio (coloring text for ascii art)


Throughout the year we work on small programs everyday. stuff like calculating remainder using mod and putting it to 'practical' use (buying pizzas and cartons of eggs).

Today we worked on a slot machine program that rolls 3 random numbers (1-3) and tests them using an if statement and rewards tokens using a counter.

But we haven't gotten really deep so I can't really understand what your class's use is :/
Its use is doing the dirty, ugly, and hair-pulling console interaction for you, while you just sit there and write simple commands :)
how would I implement it into what i pasted above though
in the console->run loop, do something like console->SetPositionText(0, 10, "Text");
Topic archived. No new replies allowed.