diff --git a/Shared/Scene.cs b/Shared/Scene.cs index 0212c15..4e929f7 100644 --- a/Shared/Scene.cs +++ b/Shared/Scene.cs @@ -74,14 +74,16 @@ namespace SemiColinGames { spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, null); Rectangle bgTarget = new Rectangle(0, 0, camera.Width, camera.Height); - float bgScale = 1f / 16; + float xScale = 1f / 16; // Changes with each layer (the layers further back scroll less). + float yScale = 1f / 4; // Constant across all layers. for (int i = 0; i < Textures.Backgrounds.Length; i++) { - float yDiff = (world.Height - camera.Bottom) * bgScale; - float yOffset = Textures.Backgrounds[i].Get.Height - camera.Height - yDiff; + Texture2D background = Textures.Backgrounds[i].Get; + float yDiff = (world.Height - camera.Bottom) * yScale; + float yOffset = background.Height - camera.Height - yDiff; Rectangle bgSource = new Rectangle( - (int) (camera.Left * bgScale), (int) yOffset, camera.Width, camera.Height); - spriteBatch.Draw(Textures.Backgrounds[i].Get, bgTarget, bgSource, Color.White); - bgScale *= 2; + (int) (camera.Left * xScale), (int) yOffset, camera.Width, camera.Height); + spriteBatch.Draw(background, bgTarget, bgSource, Color.White); + xScale *= 2; } spriteBatch.End();