diff --git a/Jumpy.Shared/Camera.cs b/Jumpy.Shared/Camera.cs index a0e3256..8ce1a7c 100644 --- a/Jumpy.Shared/Camera.cs +++ b/Jumpy.Shared/Camera.cs @@ -4,7 +4,7 @@ using System.Text; namespace Jumpy { class Camera { - public const int Width = 1920 / 4; - public const int Height = 1080 / 4; + public const int Width = 1920 / 6; + public const int Height = 1080 / 6; } } diff --git a/Jumpy.Shared/JumpyGame.cs b/Jumpy.Shared/JumpyGame.cs index bf86d88..a4babd3 100644 --- a/Jumpy.Shared/JumpyGame.cs +++ b/Jumpy.Shared/JumpyGame.cs @@ -25,6 +25,7 @@ namespace Jumpy { FpsCounter fpsCounter = new FpsCounter(); Player player; + Texture2D grassland; public JumpyGame() { graphics = new GraphicsDeviceManager(this); @@ -52,6 +53,7 @@ namespace Jumpy { spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load("font"); player = new Player(Content.Load("player_1x")); + grassland = Content.Load("grassland"); } // Called once per game. Unloads all game content. @@ -91,7 +93,19 @@ namespace Jumpy { GraphicsDevice.SetRenderTarget(renderTarget); GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); + + // Draw player. player.Draw(gameTime, spriteBatch); + + // 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++) { + Vector2 drawPos = new Vector2(i * size, Camera.Height - size); + spriteBatch.Draw(grassland, drawPos, textureSource, Color.White); + } + + // Aaaaand we're done. spriteBatch.End(); // Draw RenderTarget to screen. diff --git a/Jumpy.Shared/Player.cs b/Jumpy.Shared/Player.cs index 899bc8f..0de1c73 100644 --- a/Jumpy.Shared/Player.cs +++ b/Jumpy.Shared/Player.cs @@ -12,10 +12,11 @@ namespace Jumpy { private Texture2D texture; private const int spriteSize = 48; private const int spriteWidth = 7; + private const int bottomPadding = 5; private const int moveSpeed = 200; private const int jumpSpeed = 600; private const int gravity = 2000; - private const int groundLevel = Camera.Height - spriteSize / 2; + private const int groundLevel = Camera.Height - spriteSize / 2 + bottomPadding - 16; private Point position = new Point(Camera.Width / 2, groundLevel); private Facing facing = Facing.Right;