From 55341d8e20a99264ef234a2087a3d602ac22a26e Mon Sep 17 00:00:00 2001 From: Maxwell Edwards <93385879+MaxEdwards20@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:23:14 -0600 Subject: [PATCH] Updates speed (#57) * Adds worm updates * Shrinks map --- src/Server/GameModel.cs | 4 ++-- src/Shared/Systems/WormMovement.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Server/GameModel.cs b/src/Server/GameModel.cs index 8763ffd..d1b2cd4 100644 --- a/src/Server/GameModel.cs +++ b/src/Server/GameModel.cs @@ -18,7 +18,7 @@ public class GameModel private CollisionDetection m_systemCollisionDetection = new CollisionDetection(); private CollisionHandler m_systemCollisionHandler = new CollisionHandler(); Systems.Network m_systemNetwork = new Server.Systems.Network(); - private int mapSize = 5000; + private int mapSize = 3000; /// /// This is where the server-side simulation takes place. Messages @@ -178,7 +178,7 @@ private void createNewWorm(int clientId, string name) var headStartLocation = getLeastDenseStartLocation(); var segmentStartLocation = new Vector2(headStartLocation.X - 75, headStartLocation.Y); var rotationRate = (float) Math.PI / 1000; - var moveRate = 0.1f; + var moveRate = 0.3f; var headSize = 100; var bodySize = 80; diff --git a/src/Shared/Systems/WormMovement.cs b/src/Shared/Systems/WormMovement.cs index c60c4da..c199ca2 100644 --- a/src/Shared/Systems/WormMovement.cs +++ b/src/Shared/Systems/WormMovement.cs @@ -88,7 +88,7 @@ private void applyThrust(Entity wormHead, TimeSpan elapsedTime) var headPosition = head.get(); var frameTotalMovement = movement.moveRate * (float)elapsedTime.TotalMilliseconds; var orientation = headPosition.orientation; - float LOCATION_THRESHOLD = 2f; + float LOCATION_THRESHOLD = movement.moveRate * 20; const float MIN_SEGMENT_SPACING = 30f; const float IDEAL_SEGMENT_SPACING = 40f;