summaryrefslogtreecommitdiffstats
path: root/site/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'site/main.mjs')
-rw-r--r--site/main.mjs11
1 files changed, 7 insertions, 4 deletions
diff --git a/site/main.mjs b/site/main.mjs
index 46fea5f..f2012ab 100644
--- a/site/main.mjs
+++ b/site/main.mjs
@@ -117,10 +117,13 @@ function renderArena(robos, delta=0.0) {
ctx.clearRect(0, 0, canvas.width, canvas.height);
robos.forEach(robo => {
- const [velx, vely] = [
- robo.speedx, robo.speedy
- ].map(x => timeScale * x);
- const [x, y] = clamp(25, robo.x + velx, robo.y + vely, canvas.width, canvas.height);
+ let [x, y] = [robo.x, robo.y];
+ if (delta > 0) {
+ const [velx, vely] = [
+ robo.speedx, robo.speedy
+ ].map(x => timeScale * x);
+ [x, y] = clamp(25, robo.x + velx, robo.y + vely, canvas.width, canvas.height);
+ }
renderRobo(ctx, x, y);
});
}