CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Posts
    15

    Possible?Non-scrolling text based game diplay

    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

  2. #2
    Join Date
    Feb 2001
    Location
    teh INTARWEB
    Posts
    542
    Win32 provides a good set of Console API, which you can use. Start by looking at AllocConsole() :

    http://msdn.microsoft.com/library/de..._functions.asp

  3. #3
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    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.
    Succinct is verbose for terse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured