예제 #1
0
        float timeCounter;      // How much time has elapsed since the last time we incremented the frame counter

        public Stickman(Texture2D texture, Vector2 position, AnimatedSpriteGame game)
        {
            this.spritesheet = texture;
            this.position    = position;
            this.parent      = game;
            state            = IDLE;
            frameCounter     = 0;
            frameRate        = 1.0f / 24.0f;

            origin   = new Vector2(0, 0);
            srcRect  = new Rectangle(0, 0, spritesheet.Width / 24, spritesheet.Height / 4);
            destRect = new Rectangle((int)position.X, (int)position.Y, 50, 50);
        }
예제 #2
0
 static void Main()
 {
     using (var game = new AnimatedSpriteGame())
         game.Run();
 }