collision workey
This commit is contained in:
parent
a8681c0eb4
commit
a464da424a
5 changed files with 33 additions and 10 deletions
|
|
@ -18,7 +18,7 @@ class Obstacle extends Entity implements Collidable{
|
|||
this.pipeTop.image = pipeImagePath;
|
||||
this.pipeBottom.image = pipeImagePath;
|
||||
|
||||
this.distanceBetweenPipes = height / 4;
|
||||
this.distanceBetweenPipes = height / 2.5;
|
||||
Obstacle.startX = width;
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class Obstacle extends Entity implements Collidable{
|
|||
this.pipeBottom.draw();
|
||||
}
|
||||
|
||||
collides(o: Entity): boolean {
|
||||
public collides(o: Entity): boolean {
|
||||
return this.pipeTop.collides(o) || this.pipeBottom.collides(o);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue