1. Initialize state and time (continue from the XNA 2D games static sprite tutorial)
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D character;
Vector2 position
= new Vector2(200, 200);
Point frameSize = new Point(28, 41);
Point currentFrame = new Point(1, 0);
Point sheetSize = new Point(12, 8);
int
state = 1; // 1 = walking
state
TimeSpan
nextFrameInterval = TimeSpan.FromSeconds((float)1 / 16);
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory =
"Content";
TargetElapsedTime = new TimeSpan(0, 0, 0 , 0, 100);
//
means, frame will be updated every 100ms.
}





