Added linear interpolation between updates to mesh batch.
Cleaned up code.
This commit is contained in:
@@ -19,6 +19,7 @@ namespace SlatedGameToolkit.Tools.Commands
|
||||
interactable.Tell("Engine is already running!");
|
||||
return true;
|
||||
}
|
||||
|
||||
GameEngine.Ignite(new MainState());
|
||||
return true;
|
||||
} else if (args[0].Equals("stop")) {
|
||||
|
@@ -77,26 +77,26 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
|
||||
public void Render(double delta)
|
||||
{
|
||||
renderer.Begin(Matrix4x4.Identity);
|
||||
renderer.Begin(Matrix4x4.Identity, delta);
|
||||
renderer.Draw(logo);
|
||||
renderer.Draw(textureTester);
|
||||
renderer.Draw(untextured);
|
||||
renderer.End();
|
||||
}
|
||||
|
||||
public void Update(double delta)
|
||||
public void Update(double timeStep)
|
||||
{
|
||||
if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_DOWN)) {
|
||||
camera.Position += new Vector2(0, (float)(-0.5f * delta));
|
||||
camera.MoveTo += new Vector2(0, (-0.25f)) * (float) timeStep;
|
||||
}
|
||||
if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_UP)) {
|
||||
camera.Position += new Vector2(0, (float)(0.5f * delta));
|
||||
camera.MoveTo += new Vector2(0, (0.25f)) * (float) timeStep;
|
||||
}
|
||||
if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_LEFT)) {
|
||||
camera.Position += new Vector2((float)(-0.5f * delta), 0);
|
||||
camera.MoveTo += new Vector2((-0.25f) * (float) timeStep, 0);
|
||||
}
|
||||
if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_RIGHT)) {
|
||||
camera.Position += new Vector2((float)(0.5f * delta), 0);
|
||||
camera.MoveTo += new Vector2((0.25f) * (float) timeStep, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user