From f71178c78183bc80f1cd7906fce539b960fa0c15 Mon Sep 17 00:00:00 2001 From: lmaddox Date: Sat, 13 Jan 2024 19:21:57 -0600 Subject: [PATCH] update --- src/globals/constants.ts | 2 ++ src/level-requester.ts | 5 +++++ src/pipe/pipe-pool.ts | 2 ++ src/score-counter.ts | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/globals/constants.ts b/src/globals/constants.ts index 3d8fc6f..cc0ce01 100644 --- a/src/globals/constants.ts +++ b/src/globals/constants.ts @@ -3,6 +3,8 @@ namespace Flappy.Global { public static gameSpeed: number = 0.1; public static jumpSpeed: number = 500; public static gapSize: number = 155; + // TODO testing cheat caps + //public static gapSize: number = 155 * 3; public static gravity: number = 2000; public static pipeSpacing: number = 200; public static terminalVelocity: number = 700; diff --git a/src/level-requester.ts b/src/level-requester.ts index 83fda85..3f326d5 100644 --- a/src/level-requester.ts +++ b/src/level-requester.ts @@ -20,6 +20,11 @@ namespace Flappy { if (Math.abs(this.scoreCounter.score - this.pipePool.length) <= 10) { let startIndex = this.pipePool.length; + // TODO testing cheat cap + //if(startIndex < 69) { + // startIndex = 69; + //} + this.request(startIndex, startIndex + 20, (pipes) => { callback(pipes); this.requesting = false; diff --git a/src/pipe/pipe-pool.ts b/src/pipe/pipe-pool.ts index d9d1de0..ac87330 100644 --- a/src/pipe/pipe-pool.ts +++ b/src/pipe/pipe-pool.ts @@ -18,7 +18,9 @@ namespace Flappy { public addPipes(pipes: Array): void { for (let pipe of pipes) { let availableHeight = Global.Constants.gameHeight - this.floorHeight - Global.Constants.gapSize; + // TODO testing cheating caps let adjustedLocation = Global.Utility.map(pipe.location, 0, 1, 0.1, 0.9); + //let adjustedLocation = Global.Utility.map(pipe.location, 0.35, 0.65, 0.45, 0.55); this.create(LEVEL_OFFSET + pipe.index * Global.Constants.pipeSpacing, adjustedLocation * availableHeight); } } diff --git a/src/score-counter.ts b/src/score-counter.ts index 6cd3434..63771fa 100644 --- a/src/score-counter.ts +++ b/src/score-counter.ts @@ -24,6 +24,8 @@ namespace Flappy { } this.checkPoints.set(pipe, true); + // TODO testing cheat caps + //this.checkPoints.set(pipe, false); this.pointSound.play(); }