wosn do los
This commit is contained in:
parent
04ef8a872d
commit
43390fe7ce
5 changed files with 32 additions and 10 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue