private void SwapSpriteSheet(Texture2D spriteSheet, SpriteSheetInfo info) { this.spriteTexture = spriteSheet; this.run_info.currentFrame = 0; this.spriteSheetFramesWide = info.totalFrames; info.UpdateSourceFrame(); this.SourceRectangle = info.sourceFrame; if (info == this.ball_info) this.run_Anim_Count = 0; else if (info == this.run_info) this.ball_Anim_Count = 0; this.current_info = info; this.UpdateHitbox(); }
protected virtual void UpdateItemSpriteSheet(SpriteSheetInfo SSI) { if (animationCount >= SSI.updatesPerFrame) { SSI.currentFrame++; animationCount = 0; } else { animationCount++; return; } if (SSI.currentFrame > SSI.totalFrames - 1) SSI.currentFrame = 0; SSI.UpdateSourceFrame(); this.SourceRectangle = SSI.sourceFrame; }