Added bricks type 2 and 3
This commit is contained in:
@ -53,10 +53,10 @@ class GamePlay extends Board {
|
||||
let r = ball.update(this.ctx, this.bar.x + this.bar.w/2, this.bar.y);
|
||||
ball.collide( this.bar.x, this.bar.y, this.bar.x + this.bar.w, this.bar.y + this.bar.h );
|
||||
this.bricks.forEach(b=>{
|
||||
if(b.alive){
|
||||
if(b.lives>0){
|
||||
if ( ball.collide(b.x,b.y,b.x+b.w,b.y+b.h) ) {
|
||||
this.score.add(1);
|
||||
b.alive = false;
|
||||
b.crack();
|
||||
}
|
||||
|
||||
}});
|
||||
|
Reference in New Issue
Block a user