From 5776fec0803077c8d304f1d2c2faa798d1ec174c Mon Sep 17 00:00:00 2001 From: Micho Date: Wed, 22 May 2013 15:44:18 +0200 Subject: [PATCH] faster walking speed --- clients/anim/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/clients/anim/main.js b/clients/anim/main.js index e764e62..c33fde4 100644 --- a/clients/anim/main.js +++ b/clients/anim/main.js @@ -13,11 +13,12 @@ var nearFieldRadius = 30; var timeStep = 1000/1500; (250, 500, 1000) var decay = Math.pow(0.8, 5); -var stepSize = 50*timeStep; +var stepSize = 100*timeStep; var frameDuration = 40; var radius = 1.4; var jump = false; -var stepGridRadius = Math.ceil(stepSize/gridSize); +var maxStepGridRadius = 10; +var stepGridRadius = maxStepGridRadius; var nearFieldGridRadius = Math.ceil(nearFieldRadius/gridSize); var interval; @@ -39,8 +40,8 @@ $(function () { function setSpeed(speed) { timeStep = Math.pow(2, speed)*125/1500; - stepSize = 50*timeStep; - stepGridRadius = Math.ceil(stepSize/gridSize); + stepSize = 100*timeStep; + stepGridRadius = Math.min(Math.ceil(stepSize/gridSize), maxStepGridRadius); nearFieldGridRadius = Math.ceil(nearFieldRadius/gridSize); $('.speed').removeClass('active');