View Single Post
Old 06-04-2008, 04:55 PM   #52 (permalink)
Soccerfreak24
Support Team
Expert Zuner
 
Soccerfreak24's Avatar
 
Join Date: Nov 2007
Posts: 3,029
Soccerfreak24 is just really niceSoccerfreak24 is just really niceSoccerfreak24 is just really nice
Default

Quote:
Originally Posted by Mitch View Post
Code:
void setSongOptions()
{
    MediaPlayer.Pause();
    
    //Chose correct song and play it
    int random = RandomHelper.GetRandomInt(4);
    int randomSongIndex = RandomHelper.GetRandomInt(songCount);
    correctSong = mediaLibrary.Songs[randomSongIndex];

    //Fill list
    for (int count = 0; count < 4; count++)
    {
        randSongTitle = mediaLibrary.Songs[RandomHelper.GetRandomInt(songCount)].Name;
        while (randSongTitle == correctSong.Name)
            randSongTitle = mediaLibrary.Songs[RandomHelper.GetRandomInt(songCount)].Name;
        songTitles[count] = randSongTitle;
    }

    songTitles[random] = mediaLibrary.Songs[randomSongIndex].Name;

    MediaPlayer.Resume();
    MediaPlayer.Play(correctSong);
    correctAnswer = random;
    //roundTime = new TimeSpan();
    loadedSongs = true;
}
this should fix the chance of the same song showing up twice in the list of choices. just put this in where his setSongOption block is.
Kk, I'll try it out.

Edit: Error: The Name 'randsongtitle' does not exist in the current context
__________________

Last edited by Soccerfreak24; 06-04-2008 at 04:58 PM.





Soccerfreak24 is offline