protected override void LoadAnimations(string animationFile) { Animation anim = new Animation(0 * 64, 0 * 64, 1, 64, 64, 100, true); AddAnimation(DIRECTION.UP, "IDLE", anim); SetCurrentAnimation(DIRECTION.UP, "IDLE"); m_EntityCenter = new Vector2(0, 0);//(32, 16); }
protected override void LoadAnimations(string animationFile) { String animationID = ""; Animation anim = null; DIRECTION dir = DIRECTION.UP; int frameDelay = 150; int spriteWidth = 64; int spriteHeight = 64; int animCount =0; for(int i = 0; i < m_AnimationSizes.Count; i ++) { animationID = m_AnimationIDs[i]; if(i <=0) animCount = 0; else animCount += m_AnimationSizes[i-1]; for(int j =0; j< 8 ; j++) { anim = new Animation(animCount * spriteWidth, j * spriteHeight, m_AnimationSizes[i], spriteWidth, spriteHeight, frameDelay, true); dir = (DIRECTION)j; AddAnimation(dir, animationID, anim); } } SetCurrentAnimation(dir, animationID); }