Skip to content

Commit

Permalink
fix: reduce animation jumps by not overstepping the progression
Browse files Browse the repository at this point in the history
  • Loading branch information
yurijmikhalevich committed Dec 1, 2024
1 parent 8d2e0fa commit f3a3f4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/GameScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ watch(gameState, async (newState, prevState) => {
const updateTime = Date.now();
tickFnRef.value = () => {
const now = Date.now();
const progress = (now - updateTime) / refreshIntervalMs;
const progress = Math.min((now - updateTime) / refreshIntervalMs, 1);
for (const bot of Object.values(newState.bots)) {
const existingBot = botSpawnsRef.value[bot.spawnId];
Expand Down

0 comments on commit f3a3f4e

Please sign in to comment.