public TestScreen()
        {
            animationLookup = new Dictionary<AnimationId, AnimationContainer>();

            AnimationContainer container;

            container = new AnimationContainer();
            container.up = GetAnimation(A.anim_stand_north);
            container.down = GetAnimation(A.anim_stand_south);
            container.left = GetAnimation(A.anim_stand_west);
            container.right = GetAnimation(A.anim_stand_east);
            animationLookup[AnimationId.Stand] = container;

            container = new AnimationContainer();
            container.up = GetAnimation(A.anim_walk_north);
            container.down = GetAnimation(A.anim_walk_south);
            container.left = GetAnimation(A.anim_walk_west);
            container.right = GetAnimation(A.anim_walk_east);
            animationLookup[AnimationId.Walk] = container;

            container = new AnimationContainer();
            container.up = GetAnimation(A.anim_kick_north);
            container.down = GetAnimation(A.anim_kick_south);
            container.left = GetAnimation(A.anim_kick_west);
            container.right = GetAnimation(A.anim_kick_east);
            animationLookup[AnimationId.Kick] = container;

            groupInstance = new AnimationInstance();
            groupInstance.Init(GetAnimation(A.anim_die_green_1));
        }
 //////////////////////////////////////////////////////////////////////////////
 private void InitAnimations()
 {
     m_currentAnimation = new AnimationInstance();
 }
        private void DrawAnim(Context context, AnimationInstance instance, int x, int y)
        {
            int frameIndex = instance.FrameIndex;
            TextureImage texture = instance.Texture;

            Animation group = instance.Animation;

            Rectangle src;
            int ox = group.frames[frameIndex].ox;
            int oy = group.frames[frameIndex].oy;

            src.X = group.frames[frameIndex].x;
            src.Y = group.frames[frameIndex].y;
            src.Width = group.frames[frameIndex].w;
            src.Height = group.frames[frameIndex].h;

            context.DrawImagePart(texture, src, x - ox, y - oy);
        }
        private void AnimationFinishedCallback(AnimationInstance animation)
        {
            PlayerAnimations.Id id = (PlayerAnimations.Id)animation.id;
            switch (id)
            {
                case PlayerAnimations.Id.Die:
                {
                    Debug.Assert(!IsAlive);
                    RemoveFromField();
                    break;
                }

                case PlayerAnimations.Id.PunchBomb:
                {
                    IsPunchingBomb = false;
                    break;
                }

                case PlayerAnimations.Id.PickupBomb:
                {
                    IsPickingUpBomb = false;
                    break;
                }
            }
        }