wosn do los

This commit is contained in:
dhain 2022-11-29 11:39:32 +01:00
parent 04ef8a872d
commit 43390fe7ce
5 changed files with 32 additions and 10 deletions

View file

@ -1,11 +1,17 @@
class Obstacle {
class Obstacle extends Entity {
private pipeTop: Entity;
private pipeBottom: Entity;
private distanceBetweenPipes: number;
private padding: number;
private speed: number;
private distanceBetweenPipes: number = 50;
private padding: number = 50;
private speed: number = 10;
private static startX: number;
constructor(pipeTop: Entity, pipeBottom: Entity) {
super(pipeTop.position, pipeTop.width, height, 0);
this.pipeTop = pipeTop;
this.pipeBottom = pipeBottom;
}
private resetPosition(){
let randomY = Math.random() * (height - this.padding) + this.padding;