0

I've created a cross silverlight/xna application and I observe that movement is not that smooth.

I'm trying to move a cloud across my screen.

The update interval is once each 33 ms. I've ran the application testing ElapsedTime.Miliseconds != 33 and that one never hits, so it runs every 33 ms.

What I do each 33 ms is that i take x pos and subtract 5.4 (float) to get the speed I want.

But I observe that the movement aint that smooth, feels laggish.

4

1 回答 1

3

这不是处理这个问题的最好方法。按照您现在的方式,您的云移动将根据计算机规格以不同的速度运行。你应该做的是根据经过的时间移动你的云。这将使您的动画始终表现相同,无论您每秒可以抽出多少帧:

xPos -= elapsedTime.Miliseconds * moveSpeed;

将 moveSpeed 变量设置为适合您的值。

于 2012-10-05T16:03:09.157 回答