Password font & images
Hi. If you don't already know, I am coding a text based game in c++.
I have two questions...
1. For entering passwords, how do I make the text apear to be **** instead of the actual password??
2. So far, my games grafics consist of 6 pieces of ASCII art. I know that other games are able to use graphics in C++. How well could some graphics fit into a text based game??
It is an rpg game, with swords and archery. Im not looking for advanced graphics, but maybe some basic 2d battling. I don't need to use up/down/left/right movement, just animations of the attack sequence.
1. There is no real standard way. Look into the conio.h library, there is a function called getch() that takes unbuffered input. Take in a character, then output a '*'. If you do a search on the forum, you can find plenty of code examples of this.
2. Considering graphics aren't text, I wouldn't imagine they'd fit into a text-based game. Look into a graphics library.
Thanks for the info on passwords.
When I said a "text-based" game, I meant that the gameplay was oriented around typed commands.
What i am worried about is that graphics would dominate the interface, and the cout <<"command:" would be messed up.
I found a website that talks about
using namespace cimg_library;
Are there better libraries or should this one work?
Mmkay, when you get into game programming, you're going to find how quickly things like cout go away quickly. Yes, it's standard, but that is completely based around console commands. If you're going to write a game with graphics, you'll be using different forms of input and output.
Look into a graphics library. I'd suggest using OpenGL since it's popular, free, and more than acceptable for both 2D and 3D application. Learn the basics of that, then along the way you'll learn input and output with that.
Oh and, don't take what I said to mean "forget about iostream" it's useless. Many, many, many programmers use write and use console applications regularly. But think of it as a really handy screwdriver when right now you're looking for a hammer.