diff --git a/EvoNet/Controls/EvoSimControl.cs b/EvoNet/Controls/EvoSimControl.cs
index 8f00a0b..621f23d 100644
--- a/EvoNet/Controls/EvoSimControl.cs
+++ b/EvoNet/Controls/EvoSimControl.cs
@@ -135,10 +135,13 @@ protected override void Update(GameTime gameTime)
foreach (var module in modules)
{
- module.NotifyTick((float)gameTime.ElapsedGameTime.TotalSeconds);
+ if (!inputManager.Paused || !module.WantsFastForward)
+ {
+ module.NotifyTick((float)gameTime.ElapsedGameTime.TotalSeconds);
+ }
}
-
- if (inputManager.EnableFastForward)
+
+ if (!inputManager.Paused && inputManager.EnableFastForward)
{
DateTime startFastForward = DateTime.UtcNow;
double clampedElapsedTime = Math.Min(gameTime.ElapsedGameTime.TotalSeconds, 0.033);
diff --git a/EvoNet/EvoNet.csproj b/EvoNet/EvoNet.csproj
index d86ff87..32581d0 100644
--- a/EvoNet/EvoNet.csproj
+++ b/EvoNet/EvoNet.csproj
@@ -50,9 +50,6 @@
EvoNet.Program
-
-
-
diff --git a/EvoNet/Input/InputManager.cs b/EvoNet/Input/InputManager.cs
index fbe4dd7..5493596 100644
--- a/EvoNet/Input/InputManager.cs
+++ b/EvoNet/Input/InputManager.cs
@@ -17,6 +17,7 @@ public class InputManager : UpdateModule
bool rightMouseDown = false;
bool oldSpaceDown = false;
+ bool oldEnterDown = false;
Vector2 oldMousePosition = Vector2.Zero;
int scrollWheelValue;
@@ -25,6 +26,7 @@ public class InputManager : UpdateModule
SimulationRenderer renderer;
public bool EnableFastForward { get; private set; }
+ public bool Paused { get; private set; }
public override bool WantsFastForward
{
@@ -76,6 +78,13 @@ protected override void Update(float gameTime)
EnableFastForward = !EnableFastForward;
}
+ bool enterDown = keyboardState.IsKeyDown(Keys.Enter);
+
+ if (!oldEnterDown && enterDown)
+ {
+ Paused = !Paused;
+ }
+
if (keyboardState.IsKeyDown(Keys.R))
{
float viewportWidth = renderer.GraphicsDevice.Viewport.Width;
@@ -88,6 +97,7 @@ protected override void Update(float gameTime)
}
oldSpaceDown = spaceDown;
+ oldEnterDown = enterDown;
scrollWheelValue = mouseState.ScrollWheelValue;
oldMousePosition = new Vector2(mouseState.X, mouseState.Y);