From ef1ad52fbc909ba057dd53d79dc162b927afaa57 Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Wed, 13 Apr 2022 11:45:26 +0200
Subject: [PATCH] feat: #fe adjust difficulty ramp to 15m

---
 frontend/src/js/fight_scene.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frontend/src/js/fight_scene.ts b/frontend/src/js/fight_scene.ts
index f0325b3..6ab4dff 100644
--- a/frontend/src/js/fight_scene.ts
+++ b/frontend/src/js/fight_scene.ts
@@ -452,11 +452,11 @@ export default class FightScene extends Phaser.Scene {
 
   getDifficulty() {
     const t = this.getGameTime();
-    if (t >= 20 * 60000) return 1; // NOTE: c'mon... 20 minutes?
+    if (t >= 15 * 60000) return 1; // NOTE: c'mon... 15 minutes?
     // NOTE: this ranges in [0;20]x[0;10]
     const progression = (t) =>
       (t + Math.sin((2 * Math.PI * t) / 4) + Math.sin(2 * Math.PI * t)) / 2;
-    return progression(t / 60000) / 10;
+    return progression((t * 15) / 20 / 60000) / 10;
   }
 
   async spawnFoes() {
-- 
GitLab