Click to See Complete Forum and Search --> : Possible?Non-scrolling text based game diplay


t0by
April 16th, 2003, 07:30 AM
Hello all.
Do you know if it is possible to make a game with a display which
is "immobile"?
In other words, I have a console application with display which does not scroll when user gives commands. Is this possible?

If so, how? (I'm thinking about Windows, text based game, but
other alternatives are also welcome).


I'm writing the code with c++ and I have the game basics done.

For example, I have a game board which looks like this:

XXXXX
XXXXX
XXXXX
XXXXX
Give coordinate:

When user gives a coordinate, (0,0) the board stays at the same place (doesn't scroll forward), but draws '0', now the board is situated in the same place on display with this stuff on it:

0XXXX
XXXXX
XXXXX
XXXXX
Give coordinate:

BR,
Toby

Manish Malik
April 16th, 2003, 08:33 AM
Win32 provides a good set of Console API, which you can use. Start by looking at AllocConsole() :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp

cup
April 17th, 2003, 01:43 AM
You have to issue a "reposition at the top left" before you start your redraw. If you are using an ANSI terminal (xterm, dtterm or DOS prompt with ANSI.sys loaded), you could try

printf ("\033[0;0H");

Alternatively if you are using TurboC it is something like gotoxy(0,0).

When it comes to the prompt line, you have to wipe out the entire line and rewrite.