diff --git a/Jumpy.Shared/JumpyGame.cs b/Jumpy.Shared/JumpyGame.cs index 3bc9bf8..80a681d 100644 --- a/Jumpy.Shared/JumpyGame.cs +++ b/Jumpy.Shared/JumpyGame.cs @@ -63,12 +63,13 @@ namespace Jumpy { protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); + const int spriteSize = 144; int frameNum = gameTime.TotalGameTime.Milliseconds / 250; if (frameNum == 3) { frameNum = 1; } - int sourceX = 144 * frameNum + 144 * 6; - int sourceY = 144 * 0; + int sourceX = spriteTileSize * frameNum + spriteTileSize * 3; + int sourceY = spriteTileSize * 0; Rectangle source = new Rectangle(sourceX, sourceY, 144, 144); // Vector2 position = new Vector2(0, 0); Vector2 position = new Vector2(100, 100);