Added the bricks (and improve the bouncing)
This commit is contained in:
6
Board.js
6
Board.js
@ -29,13 +29,17 @@ class Board {
|
||||
}
|
||||
|
||||
next(nextStage) {
|
||||
this.loopStop();
|
||||
this.resolve(nextStage);
|
||||
}
|
||||
|
||||
loopStop() {
|
||||
this.stop = true;
|
||||
if (this.requestID) {
|
||||
cancelAnimationFrame(this.requestID);
|
||||
this.requestID = null;
|
||||
}
|
||||
this.ctx.clearRect(0, 0, this.w, this.h);
|
||||
this.resolve(nextStage);
|
||||
}
|
||||
|
||||
loop() {
|
||||
|
Reference in New Issue
Block a user