From ba459a9738c2dbe84e432e490941943d2f577ca4 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 12 Dec 2019 14:00:07 -0500 Subject: [PATCH] move comment to appropriate place GitOrigin-RevId: e0555ac9dde749b46c629218ebabc29a0cbce678 --- Jumpy.Shared/Player.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jumpy.Shared/Player.cs b/Jumpy.Shared/Player.cs index f0ea924..3386096 100644 --- a/Jumpy.Shared/Player.cs +++ b/Jumpy.Shared/Player.cs @@ -13,7 +13,6 @@ namespace Jumpy { private Texture2D texture; private const int spriteSize = 48; private const int spriteWidth = 7; - private const int bottomPadding = 1; private const int moveSpeed = 150; private const int jumpSpeed = 500; private const int gravity = 1500; @@ -30,23 +29,18 @@ namespace Jumpy { this.texture = texture; } - // TODO: refactor input to have a virtual "which directions & buttons were being pressed" - // instead of complicated if-statements in this function. public void Update( GameTime time, History gamePad, List collisionTargets) { Point oldPosition = position; AirState oldAirState = airState; UpdateFromGamePad(time, gamePad); - bool someIntersection = false; - Rectangle playerBbox = new Rectangle(position.X - spriteWidth, position.Y - 8, spriteWidth * 2, 27); bool standingOnGround = false; foreach (var rect in collisionTargets) { playerBbox = new Rectangle(position.X - spriteWidth, position.Y - 8, spriteWidth * 2, 27); if (playerBbox.Intersects(rect)) { - someIntersection = true; if (oldPosition.Y > position.Y) { int diff = playerBbox.Top - rect.Bottom; position.Y -= diff; @@ -85,6 +79,8 @@ namespace Jumpy { } } + // TODO: refactor input to have a virtual "which directions & buttons were being pressed" + // instead of complicated if-statements in this function. void UpdateFromGamePad(GameTime time, History gamePad) { if (gamePad[0].IsButtonDown(Buttons.A) && airState == AirState.Ground) { pose = Pose.Jumping;