Wait number of seconds?! please help

This is a discussion on Wait number of seconds?! please help within the Game Programming forums, part of the General Programming Boards category; Are there any methods in c# that wait a number of seconds?! Im doing a game in XNA and I ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    35

    Wait number of seconds?! please help

    Are there any methods in c# that wait a number of seconds?! Im doing a game in XNA and I need to have a delay!

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    48
    You can sleep the thread ( Application.Thread.Sleep() I believe, but truth is, you dont want to do this.

    Your best bet is to alter your game logic. In XNA on update, you are passed the delta in time since the last update. Simply create a counter variable when you want to paused, increment it every update frame, and basically "Do Nothing" until that value > your needed time threshold. This will effectively pause your game logic, without impacting other subsystems ( like rendering )

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Convert seconds to hours, minutes and seconds
    By kkk in forum C Programming
    Replies: 2
    Last Post: 07-26-2011, 10:47 AM
  2. delay function in C in number of seconds
    By nerio in forum C Programming
    Replies: 4
    Last Post: 07-22-2011, 04:47 AM
  3. wait X seconds implementation
    By ghostdlr in forum Linux Programming
    Replies: 4
    Last Post: 02-16-2010, 02:16 PM
  4. Every x Seconds?
    By bobbinator in forum C++ Programming
    Replies: 14
    Last Post: 08-23-2009, 08:46 AM

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