Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmaddox committed Jan 14, 2024
1 parent 9277f89 commit f71178c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/globals/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/level-requester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/pipe/pipe-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ namespace Flappy {
public addPipes(pipes: Array<IPipe>): 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);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/score-counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace Flappy {
}

this.checkPoints.set(pipe, true);
// TODO testing cheat caps
//this.checkPoints.set(pipe, false);
this.pointSound.play();
}

Expand Down

0 comments on commit f71178c

Please sign in to comment.