more readability fixed via Visual Studio suggestions
GitOrigin-RevId: 330f13485cee32f3a069442bad69c57911a0a34c
This commit is contained in:
parent
4b14aef1b5
commit
84fa044675
@ -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];
|
||||||
|
@ -107,8 +107,9 @@ namespace SemiColinGames {
|
|||||||
|
|
||||||
// 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;
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user