Added sprites to the bricks and touch control
This commit is contained in:
@ -8,7 +8,9 @@ class Board {
|
||||
this.y = ctx.canvas.height / 2 - 48;
|
||||
|
||||
this.w = this.ctx.canvas.width;
|
||||
this.h = this.ctx.canvas.height
|
||||
this.h = this.ctx.canvas.height;
|
||||
|
||||
this.img = resources.get('bg01');
|
||||
}
|
||||
|
||||
run() {
|
||||
@ -45,7 +47,8 @@ class Board {
|
||||
loop() {
|
||||
if (this.stop) return;
|
||||
|
||||
this.ctx.clearRect(0, 0, this.w, this.h);
|
||||
// this.ctx.clearRect(0, 0, this.w, this.h);
|
||||
this.ctx.drawImage(this.img, 0, 0);
|
||||
this.update();
|
||||
this.requestID = requestAnimationFrame( ()=>this.loop() );
|
||||
}
|
||||
|
Reference in New Issue
Block a user