more readability fixed via Visual Studio suggestions

GitOrigin-RevId: 330f13485cee32f3a069442bad69c57911a0a34c
This commit is contained in:
Colin McMillen 2020-01-24 21:09:09 -05:00
parent 4b14aef1b5
commit 84fa044675
3 changed files with 9 additions and 7 deletions

View File

@ -20,7 +20,7 @@ namespace SemiColinGames {
int dy = -Math.Abs(y2 - y1); int dy = -Math.Abs(y2 - y1);
int stepY = y1 < y2 ? 1 : -1; int stepY = y1 < y2 ? 1 : -1;
int error = dx + dy; int error = dx + dy;
int errorXY = 0; // Error value e_xy from the PDF. int errorXY; // Error value e_xy from the PDF.
// The size of the output is the size of the longer dimension, plus one. // The size of the output is the size of the longer dimension, plus one.
int resultSize = Math.Max(dx, -dy) + 1; int resultSize = Math.Max(dx, -dy) + 1;
var result = new Point[resultSize]; var result = new Point[resultSize];

View File

@ -104,11 +104,12 @@ namespace SemiColinGames {
pose = Pose.Standing; pose = Pose.Standing;
} }
} }
// Returns the desired (dx, dy) for the player to move this frame. // Returns the desired (dx, dy) for the player to move this frame.
Vector2 HandleInput(float modelTime, History<Input> input) { Vector2 HandleInput(float modelTime, History<Input> input) {
Vector2 result = new Vector2(); Vector2 result = new Vector2() {
result.X = (int) (input[0].Motion.X * moveSpeed * modelTime); X = (int) (input[0].Motion.X * moveSpeed * modelTime)
};
if (input[0].Jump && !input[1].Jump && jumps > 0) { if (input[0].Jump && !input[1].Jump && jumps > 0) {
jumpTime = 0.3; jumpTime = 0.3;

View File

@ -27,8 +27,9 @@ namespace SemiColinGames {
readonly Camera camera = new Camera(); readonly Camera camera = new Camera();
public SneakGame() { public SneakGame() {
graphics = new GraphicsDeviceManager(this); graphics = new GraphicsDeviceManager(this) {
graphics.SynchronizeWithVerticalRetrace = false; SynchronizeWithVerticalRetrace = false
};
IsFixedTimeStep = true; IsFixedTimeStep = true;
TargetElapsedTime = TimeSpan.FromSeconds(1.0 / 60); TargetElapsedTime = TimeSpan.FromSeconds(1.0 / 60);
IsMouseVisible = true; IsMouseVisible = true;
@ -107,7 +108,7 @@ namespace SemiColinGames {
string fpsText = $"{GraphicsDevice.Viewport.Width}x{GraphicsDevice.Viewport.Height}, " + string fpsText = $"{GraphicsDevice.Viewport.Width}x{GraphicsDevice.Viewport.Height}, " +
$"{fpsCounter.Fps} FPS"; $"{fpsCounter.Fps} FPS";
if (paused) { if (paused) {
fpsText = fpsText + " (paused)"; fpsText += " (paused)";
} }
Debug.SetFpsText(fpsText); Debug.SetFpsText(fpsText);