Results 1 to 2 of 2

Thread: Threading Console.Beeps Pausing/Resuming

  1. #1
    Aswarin is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2013
    Posts
    1
    Reputation
    0

    Threading Console.Beeps Pausing/Resuming

    I have got a day night cycle completely working in a text adventure I'm programming however I want different music to play using console.beep at different times while you are playing the game.
    Is there anyway to Pause a thread then resume it? Whenever I use "threadname.suspend()" it says it is deprecated.

    an example would be,

    If night = true then
    musicday.suspend()
    musicnight.resume()

    if night = fale then
    musicnight.suspend()
    musicday.resume()

    Please if you have any experience with solving these problems any assistance would be appreciated.

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,773
    Reputation
    1703
    Using a separate thread for each sound track is a poor choice. Just write a method for each sound track and then have the one thread call the appropriate method depending on the "time of day".

Bookmarks

Posting Permissions

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