Adventure game creation

How do I constantly display information that is being updated(Health bars) and not clearing it while clearing the rest of screen? (Code isn't even close to done, I just want to know for future reference, thx!)

[
#include "pch.h"
#include "screen.h"
#include <iostream>
#include <iomanip>

using namespace std;


/*
Enemy Types:
-Bat
-Spider
-Golem
-Bandit
-

int main()
{
string name;

cout << "Welcome adventurer! Before we begin your adventure, what is your name?\n";
getline.cin >> name;

system("cls");

cout << "I wish you luck, << name << ".\n";

system("cls");

cout << "You will encounter many enemies and other things within the dungeon.\n"
"Enemies will get stronger the more you defeat them!\n"
"Upgrade your health, armor, and damage in order to defeat more enemies!\n"
"Press a button to let me know when you're ready and I will take you to the entrance.";

system("pause");
system("cls");

cout << "This is as far as I go, from here on out you're on your own.\n";
"Once again I wish you luck << name << ".\n";

system("pause");
system("cls");

cout << "*Entering the cave you are immediately greeted by darkness!*";

randEnemy();
cout << "Lighting a torch you see a << enemy << " blocking your path. Time to fight!\n";

system("cls");



}
]
Last edited on
If you're looking for a grand vision of many separate screen areas, you might want to look at 'curses'.
https://www.gnu.org/software/ncurses/ncurses.html
https://github.com/wmcbrine/PDCurses (might be better, since you're on Windows)

Or roll your own using the Win32 Console API.
https://docs.microsoft.com/en-us/windows/console/console-reference

Topic archived. No new replies allowed.