Password font & images

This is a discussion on Password font & images within the C++ Programming forums, part of the General Programming Boards category; Hi. If you don't already know, I am coding a text based game in c++. I have two questions... 1. ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    9

    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.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    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.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    9

    --

    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


    Code:
    #include "CImg.h"
      using namespace cimg_library;
    library site

    Are there better libraries or should this one work?

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    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.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with my font manager
    By hannibar in forum C Programming
    Replies: 1
    Last Post: 03-07-2006, 07:03 AM
  2. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 02:42 AM
  3. destroywindow() problem
    By algi in forum Windows Programming
    Replies: 6
    Last Post: 03-27-2005, 10:40 PM
  4. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  5. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21