Added sprites to the bricks and touch control
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user