using Microsoft.Xna.Framework; namespace BouncyCatIsBouncy { class Track { Curve2D m_curve = new Curve2D(); float m_position = .5f; const float POSITION_DELTA = .00025f; public Track() { m_curve.AddPosition(0.0f, new Vector2(50, 420)); m_curve.AddPosition(0.5f, new Vector2(100, 670)); m_curve.AddPosition(1.0f, new Vector2(150, 670)); } public Vector2 GetCurrentPosition() { return m_curve.Evaluate(m_position); } public void MoveLeft(float dt) { m_position -= POSITION_DELTA * dt; } public void MoveRight(float dt) { m_position += POSITION_DELTA * dt; } } }