fixed clouds not spawning smoothly
This commit is contained in:
parent
26ea68b1cd
commit
7f4a55a372
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ namespace GreatSpringGameJam {
|
||||||
for (var x = 0; x < parW; x += mountains.Width * 2)
|
for (var x = 0; x < parW; x += mountains.Width * 2)
|
||||||
batch.Draw(mountains, parallax + new Vector2(x, parH - mountains.Height * 2), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
batch.Draw(mountains, parallax + new Vector2(x, parH - mountains.Height * 2), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
||||||
var clouds = BackgroundTexture[0, 4, 8, 2];
|
var clouds = BackgroundTexture[0, 4, 8, 2];
|
||||||
for (var x = -1; x < parW / clouds.Width / 2; x++) {
|
for (var x = -2; x < parW / clouds.Width / 2; x++) {
|
||||||
var pos = new Vector2(x * clouds.Width * 2, parH - mountains.Height * 2 - clouds.Height * 4);
|
var pos = new Vector2(x * clouds.Width * 2, parH - mountains.Height * 2 - clouds.Height * 4);
|
||||||
batch.Draw(clouds, parallax + pos + new Vector2((float) time.TotalGameTime.TotalSeconds * 3 % (clouds.Width * 2), 0), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
batch.Draw(clouds, parallax + pos + new Vector2((float) time.TotalGameTime.TotalSeconds * 3 % (clouds.Width * 2), 0), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
||||||
batch.Draw(clouds, parallax + pos + new Vector2(clouds.Width + (float) time.TotalGameTime.TotalSeconds * 2.5F % (clouds.Width * 2), clouds.Height * 1.5F), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
batch.Draw(clouds, parallax + pos + new Vector2(clouds.Width + (float) time.TotalGameTime.TotalSeconds * 2.5F % (clouds.Width * 2), clouds.Height * 1.5F), Color.White * 0.5F, 0, Vector2.Zero, 2, SpriteEffects.None, 0);
|
||||||
|
|
Loading…
Reference in a new issue