I was trying to think of a way to vary the attacks in a pseudo-random fashion. The method I use now is to have a counter linked to the frame-rate and using it to give me a more or less random number. This seems to be sorta clunky though. I could add a module that uses the seed random function in C# I suppose. Does anyone have a better idea for this? I think a random number generator may be worth doing in its own right.
Let see... this should give a random number...
Random randNum = new Random();
randNum.Next(1, 10); // No larger than 10, no smaller than 1
and this would use the seed from the frame-rate linked counter
get
{
return counter.m_nValue;
}
setRandom randNum = new Random(counter.m_nValue);
randNum.Next();
Additionally I was wondering how to play a brief opening video and have it play once and then go to the menu map. At present I have it open in the menu map and it plays the video once based and increments an on/off counter in order to avoid the opening clip every time the game drops back to the menu level (i.e when esc is pressed or a game is saved)
The trouble with this is, there is a brief lag playing the clip when the game opens and the the menu screen is shown for a moment before the clip plays. Ideally, the clip would be in its own map and would play all the way through, then dump the user to the menu screen.