好的,我知道出了什么问题。
问题是,我更改帧的算法错误,有时会跳到空白帧。看代码:
Rectangle rectWater = new Rectangle(((currentFrame % numerOfWaterSpriteFrames) % horizontalNumerOfWaterSpriteFrames) * (int)sizeOfWaterFrame.X, ((aktualnaFramka % numerOfWaterSpriteFrames) / horizontalNumerOfWaterSpriteFrames) * (int)sizeOfWaterFrame.Y, (int)sizeOfWaterFrame.X, (int)sizeOfWaterFrame.Y);
//The correct code
我没有在第一个和第二个 Rectangle 构造函数参数中通过numerOfWaterSpriteFrames 调制currentFrame 。像这样:
Rectangle rectWater = new Rectangle((currentFrame % horizontalNumerOfWaterSpriteFrames) * (int)sizeOfWaterFrame.X, (aktualnaFramka / horizontalNumerOfWaterSpriteFrames) * (int)sizeOfWaterFrame.Y, (int)sizeOfWaterFrame.X, (int)sizeOfWaterFrame.Y);
//The wrong code
现在好了。