scaling & localstorage

- everything scaling now
- game-score, game-isRunning and game-playTime now saving in localstorage on game start and end
This commit is contained in:
dhain 2023-01-20 14:32:45 +01:00
parent 6ceccce759
commit c8528c945e
3 changed files with 62 additions and 42 deletions

View file

@ -4,7 +4,7 @@
class Obstacle extends Entity implements Collidable {
private pipeTop: Pipe;
private pipeBottom: Pipe;
private readonly padding: number = 150;
private readonly padding: number;
private readonly speed: number = 3;
private static _distanceBetweenPipes: number;
@ -27,6 +27,7 @@ class Obstacle extends Entity implements Collidable {
*/
constructor(position: Position, obstacleWidth: number, obstacleHeight: number, image: p5.Image) {
super(position, obstacleWidth, obstacleHeight, 0);
this.padding = height / 6.6666666666666666;
this.createPipes(position, obstacleHeight, obstacleWidth, image);
}