2011-08-22 55 views

回答

2
Vector2 Speed = new Vector2(0,100); // Pixels x Second 
Vector2 Position = ScreenCenter; 

public void Update(GameTime gametime) 
{ 
    float Seconds = (float) gametime.Elapsed.TotalSeconds; 

    Position += Speed * Seconds; 
} 
+0

這讓對象向一個方向移動,但它看起來不像一個持續的移動,因爲它會佔用一些時間併產生抖動。 – marteksmartek

+1

我想你是在windows中測試,設置IsFixedTimeStep = false和graphics.SynchronizeWithVerticalRetrace = false。 – Blau

+0

完美,這是我需要:) – marteksmartek