Sunday, 15 May 2011

2d - C# after set amount of seconds change -


I'm looking for some code for a while, no success.

I have so that after the space bar is pressed, my phantom turns into a different phantom and once again when I press the space bar again, it changes the original phantom back.

I need some code to change the sprite to its original set after 3 seconds after pressing the space bar for the first time and changing the phantom.

Ive been watching timer and countdown timer and there is no reason for it.

Any help is appreciated Thanks.

Perhaps you can use the stopwatch class and do something like that?

  stopwatch SW = new stopwatch (); // sw cotructor sw.start (); // Stopwatch start (true) {sw.Stop (); // Stop the time measurement (sw.ElapsedMilliseconds> = 3000) // Check that the desired period of time has expired; // stop loop and back to the second sw.Start (); // resume stopwatch}  

No comments:

Post a Comment