Timing in a C# Managed DirectX Game

Im currently programming a C# 2d Game Engine in Managed DirectX and I am having some problems with how to do timing. Ok for now I have a class set up for timing (copied from mdxutil.cs) which gives very accurate time. Now my problem is how to use this time. First I have a class called Sprite, with a method Update(double absoluteTime) and each frame I call this method and pass the current time from the timer. Now lets say I want to move the sprite (according to its velocity) 5 times per second, and I want to update the sprites animation every 2 times a second. How would I use the timer to accomplish this. Is my approach right or am I completely off track?

Thanks

[682 byte] By [Diirewolf] at [2007-12-26]
# 1
You're on the right track. Now you just need to give your sprite class some variables to track when the animations were last updated and when they were last moved. I typically have a "Move" variable that counts down to zero from whatever time I want, so each update will subtracted the elapsed seconds from the Move variable, when that variable is less than or equal to zero, then I move my sprite, reset the variable and repeat.

On a side note, I see that you're working on a 2D game engine for Managed Direct X. Have you considered porting your code to XNA? Just something you might want to take a look at. Microsoft may have made your life just a bit easier with the stuff they are doing with the XNA framework.

GeorgeClingerman at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 2

I don't want to move to XNA yet although I have checked it out. Thanks for the info though, I used a very similar method before but this just cleared all my doubts.

Thanks again

Diirewolf at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...