diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-26 23:47:59 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-26 23:47:59 -0400 |
| commit | 0d2d8cd897e94bd94e0b3ae7c6ce9aa580a44a0a (patch) | |
| tree | e9039d1c3aedca515d6cb499451d4b73aca4f5fd /2026/games/cammymoop/js/hints.js | |
| parent | 242943e5b023ce40eb3be826c418a478d4672f78 (diff) | |
Add a_tension_span
Diffstat (limited to '2026/games/cammymoop/js/hints.js')
| -rw-r--r-- | 2026/games/cammymoop/js/hints.js | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/2026/games/cammymoop/js/hints.js b/2026/games/cammymoop/js/hints.js deleted file mode 100644 index 250c080..0000000 --- a/2026/games/cammymoop/js/hints.js +++ /dev/null @@ -1,83 +0,0 @@ - -const nums = ['1', '2', '3', '4', '5', '6']; -const shortNames = []; - -M.Hint = class extends Phaser.GameObjects.Container -{ - constructor(scene) { - super(scene); - this.rows = []; - this.allImgs = []; - this.maxWidth = 0; - } - - setupExample() { - this.addToDisplayList(); - this.addRow(["equal", "5", "", "arrow", "", "skull", "dice"]); - this.addRow(["greater", "2", "", "arrow", "", "skull"]); - this.build(); - } - - setup(hintData) { - this.addToDisplayList(); - this.rows = []; - for (let row of hintData) { - this.addRow(row); - } - this.build(); - } - - addRow(contents) { - this.rows.push(contents); - } - - clearRows() { - this.rows = []; - } - - clearImgs() { - for (let img of this.allImgs) { - img.destroy(); - } - this.allImgs = []; - } - - build() { - this.clearImgs(); - - for (let i = 0; i < this.rows.length; i++) { - // Place rows in reverse order from bottom to top, moving coords upward so the end result is in order - const row = this.rows[this.rows.length - 1 - i]; - if (row.length < 1) { - continue; - } - const row_width = row.length * 8; - for (let j = 0; j < row.length; j++) { - if (row[j] === '') { - continue; - } - const charImg = this.getImageForKey(row[j]); - this.allImgs.push(charImg); - this.add(charImg); - charImg.x = (8 * j) - (row_width/2); - charImg.y = -i * 10; - } - } - } - - getImageForKey(charKey) { - if (nums.includes(charKey)) { - return this.newImage("number_icons", parseInt(charKey) - 1); - } else { - return this.newImage(charKey + "_icon"); - } - } - - newImage(texKey, frame = '') { - if (frame !== '') { - return new Phaser.GameObjects.Image(this.scene, 0, 0, texKey, frame); - } else { - return new Phaser.GameObjects.Image(this.scene, 0, 0, texKey); - } - } -}; |
