Added sprites to the bricks and touch control

This commit is contained in:
2021-11-17 20:12:25 +01:00
parent bc3ef31728
commit 44e93e5c6d
9 changed files with 83 additions and 30 deletions

View File

@ -4,12 +4,16 @@ class Resources {
this.loading = 0;
this.resources = {};
this.load('bg01', 'jpg');
this.load('ball');
this.load('bar');
this.load('b31');
this.load('b32');
this.load('b33');
}
load(res) {
load(res, ext='png') {
let _this = this;
this.total++;
this.loading++;
@ -17,7 +21,7 @@ class Resources {
this.resources[res].onload = function () {
_this.loading--;
}
this.resources[res].src = 'assets/imgs/' + res + '.png';
this.resources[res].src = 'assets/imgs/' + res + '.'+ext;
}
get(res) {