diff --git a/index.html b/index.html index 629648d..29ccfa1 100644 --- a/index.html +++ b/index.html @@ -26,14 +26,14 @@ Translation & Rotation
- - + + 0.0
- - + + 0.0
@@ -50,8 +50,8 @@ Performance Limits
- - + + 4.0
diff --git a/script.js b/script.js index a663720..ed35737 100644 --- a/script.js +++ b/script.js @@ -301,24 +301,9 @@ function animate() { ctx.translate(canvas.width / 2, canvas.height / 2); // Animation for testing - xSpeed += xDir; - ySpeed += yDir; - turnSpeed += turnDir; - if (xSpeed > 100) - xDir = -1; - else if (xSpeed < -100) - xDir = 1; - - if (ySpeed > 100) - yDir = -0.8; - else if (ySpeed < -100) - yDir = 0.8; - - if (turnSpeed > 1) - turnDir = -0.01; - else if (turnSpeed < -1) - turnDir = 0.01; - + xSpeed = vxSlider.value; + ySpeed = vySlider.value; + turnSpeed = omegaSlider.value; // Animate the grid with robot movement let offsetSpeedDivisor = (100 - gridSquareSize <= 0 ? 1 : 100 - gridSquareSize);