View Poll Results: How many games have you designed?

Voters
15. You may not vote on this poll
  • +10 games

    2 13.33%
  • 7-10 games

    0 0%
  • 5-8 games

    0 0%
  • 1-4 games

    10 66.67%
  • I've never designed a game.

    3 20.00%

Thread: Pausing my game

  1. #1

    Pausing my game

    I am making a game tentatively called xScape. It is a text-based RPG game, and after a few opening inquiries about the user, it shows the character profile. This is done using some couts with the variables, then the game SHOULD pause and let the user see the profile, however it doesn't, and proceeds to the main menu. Since my project is huge, i can't give you the source that it runs through to get there, as it would require about five headers and one source. Any hints on how i can get the game to pause?

    I have already tried:

    1) system("pause");

    2) cin.get();

    3) {cin >> devnull;}

    4) getche();
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    267
    you could use the _sleep(long milliseconds) function to 'pause' the game for a given amount of time...

    otherwise getch() works as a quick pause for me

  3. #3
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788

    This is done using some couts with the variables, then the game SHOULD pause and let the user see the profile, however it doesn't, and proceeds to the main menu
    Could be the infamous input buffer problem. Try flushing the input buffer after text input functions.

    HINT: Don't use fflush().

  4. #4
    I hate it when that happens. When I made my first game (a text based RPG) I had this one part where you gotta type in a password, it kept skipping past it. I got so mad I punched my monitor, and it busted a scab I had on my hand.

  5. #5
    Originally posted by The Dog

    Could be the infamous input buffer problem. Try flushing the input buffer after text input functions.

    HINT: Don't use fflush().
    How am i supposed to flush it without using fflush()?

  6. #6
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Perhaps if you did a board search, you might have found something.

    I found these lying around on the board:

    fflush(stdin)
    How to flush the buffer

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  3. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  4. C++ Game of Life Program
    By rayrayj52 in forum C++ Programming
    Replies: 16
    Last Post: 09-26-2004, 03:58 PM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM