From 59246719c5ed96ad1cc9d89cce09a731e132598c Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 24 Mar 2018 19:01:07 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 1031 bytes modified --- 21g30t1e75.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/21g30t1e75.js b/21g30t1e75.js index a61064f..2af02ca 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -143,6 +143,28 @@ this.imagePowerupSlow = GameLib.EntityManager.Instance.findComponentById('nhd62 this.imageHeart = GameLib.EntityManager.Instance.findComponentById('oa5xl4n05z'); this.imageHeartGrey = GameLib.EntityManager.Instance.findComponentById('bh4miaqzwe'); +this.imagePauseButton = GameLib.EntityManager.Instance.findComponentById('x0ewaqg5fu'); +this.imageSoundButton = GameLib.EntityManager.Instance.findComponentById('w8sppso1z4'); +this.imageDownButton = GameLib.EntityManager.Instance.findComponentById('t0w8hmodl3'); +this.imageUpButton = GameLib.EntityManager.Instance.findComponentById('4v63jgi7t5'); +this.imageRightButton = GameLib.EntityManager.Instance.findComponentById('21o4zucc3c'); +this.imageLeftButton = GameLib.EntityManager.Instance.findComponentById('qkq4gs682q'); + +GameLib.CustomCode.prototype.createButtonAlphas = function(image) { + var pixels = image.getPixelData(); + image.alphas = []; + for (i = 0; i < pixels.length; i += 4) { + image.alphas.push(pixels[i + 3]); + } +}.bind(this) + +this.createButtonAlphas(this.imagePauseButton); +this.createButtonAlphas(this.imageSoundButton); +this.createButtonAlphas(this.imageDownButton); +this.createButtonAlphas(this.imageUpButton); +this.createButtonAlphas(this.imageRightButton); +this.createButtonAlphas(this.imageLeftButton); + /** * Other Objects (Scene) */