From 3af02981c41d9fe20ed8df45dfa03de1cb250d5b Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Tue, 10 Dec 2019 16:49:27 -0500 Subject: [PATCH] add rock-y ground tiles GitOrigin-RevId: fd490a5a2c57d3e4c141a8690393f56224f4a46e --- Jumpy.Shared/JumpyGame.cs | 9 +++++++-- Jumpy.Shared/Player.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Jumpy.Shared/JumpyGame.cs b/Jumpy.Shared/JumpyGame.cs index 5bccb6e..58c8e3c 100644 --- a/Jumpy.Shared/JumpyGame.cs +++ b/Jumpy.Shared/JumpyGame.cs @@ -109,10 +109,15 @@ namespace Jumpy { // Draw foreground tiles. int size = 16; - Rectangle textureSource = new Rectangle(3 * size, 0 * size, size, size); for (int i = 0; i < Camera.Width / size; i++) { + Rectangle source = new Rectangle(3 * size, 0 * size, size, size); + Vector2 drawPos = new Vector2(i * size, Camera.Height - size * 2); + spriteBatch.Draw(grassland, drawPos, source, Color.White); + } + for (int i = 0; i < Camera.Width / size; i++) { + Rectangle source = new Rectangle(3 * size, 1 * size, size, size); Vector2 drawPos = new Vector2(i * size, Camera.Height - size); - spriteBatch.Draw(grassland, drawPos, textureSource, Color.White); + spriteBatch.Draw(grassland, drawPos, source, Color.White); } // Aaaaand we're done. diff --git a/Jumpy.Shared/Player.cs b/Jumpy.Shared/Player.cs index 0de1c73..d44a99d 100644 --- a/Jumpy.Shared/Player.cs +++ b/Jumpy.Shared/Player.cs @@ -16,7 +16,7 @@ namespace Jumpy { private const int moveSpeed = 200; private const int jumpSpeed = 600; private const int gravity = 2000; - private const int groundLevel = Camera.Height - spriteSize / 2 + bottomPadding - 16; + private const int groundLevel = Camera.Height - spriteSize / 2 + bottomPadding - 32; private Point position = new Point(Camera.Width / 2, groundLevel); private Facing facing = Facing.Right;