Search code examples
c#-4.0xna-4.0

How to use C# XNA timer?


I am using XNA my rocket is creating smoke objects when it fly. I need to know how to use some timer in XNA for these simple smoke objects. When the object is create ...wait 2 seconds and destroy this object. Can somebody help pls?


Solution

  • Your update method should be being passed a GameTime object. Record the time in ctor or setup method, and compare it every update. Once a specified period has elapsed, run your teardown method.