Change-Id: I34245922a245981954a4f5bc458db7f25de5d90c
Piano.prototype = {
touchPianoKey: [],
lockIds: {},
- audio: []
+ audio: [],
+ whiteCache: null,
+ blackCache: null
};
Piano.prototype.bindEvents = function bindEvents() {
}
};
+ Piano.prototype.cacheImages = function cacheImages() {
+ this.whiteCache = new Image();
+ this.whiteCache.src = "white_pressed.png";
+ this.blackCache = new Image();
+ this.blackCache.src = "black_pressed.png";
+ };
+
Piano.prototype.init = function init() {
+ this.cacheImages();
this.bindEvents();
this.audioInit();
};