Results 1 to 8 of 8

Thread: Pausing a game

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lebanon
    Posts
    90

    Pausing a game

    Hi.
    I want my game to be paused when the player presses P or something. How can I do that?
    By the way, I'm using DDraw

  2. #2
    Zaei
    Guest
    If you have rendering separate from game state updates, just put an if statement around the updating, and use a boolean value that is toggled when the user pauses.

    Z.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lebanon
    Posts
    90
    I'm sorry but I did not get what you meant by:

    If you have rendering separate from game state updates,

  4. #4
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    I think he means something like

    Code:
    Do game loop
    
    If blnGo = true then
            Do all the funky game updating here
    En if
    
    Get keyboard presses
    
    If 'P' pressed the blnGo = not blnGo 'toggles the paused state of the game
    
    loop until 'Q' pressed 'for quit

    Or something along those lines
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lebanon
    Posts
    90
    Ok Thank you, I'm gonna try that.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lebanon
    Posts
    90

    OK.

    Thank you for your help, the code worked.

  7. #7
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    So,

    When do we get to see your game.....
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Lebanon
    Posts
    90
    You really are interested?
    But I don't think you would want to see it because my game, as it is, has many problems.

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