Browse Source

more readability fixed via Visual Studio suggestions

GitOrigin-RevId: 330f13485c
master
Colin McMillen 4 years ago
parent
commit
84fa044675
  1. 2
      Shared/Line.cs
  2. 7
      Shared/Player.cs
  3. 7
      Shared/SneakGame.cs

2
Shared/Line.cs

@ -20,7 +20,7 @@ namespace SemiColinGames {
int dy = -Math.Abs(y2 - y1);
int stepY = y1 < y2 ? 1 : -1;
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.
int resultSize = Math.Max(dx, -dy) + 1;
var result = new Point[resultSize];

7
Shared/Player.cs

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

7
Shared/SneakGame.cs

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

Loading…
Cancel
Save