forked from evmar/jelly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jelly.js.map
1 lines (1 loc) · 43.4 KB
/
jelly.js.map
1
{"version":3,"sources":["src/es6/jelly.js"],"names":[],"mappings":"AAAA,WAAW,CAAC;AAEZ,AAAI,EAAA,CAAA,MAAK,EAAI,EACX,2LASe,CAEf,4LASe,CAEf,4LASe,CAEf,4LASe,CAEf,yKAQe,CAEf,4LASe,CAEf,4LASe,CAEf,4LASe,CAEf,4LASe,CAEf,4LASe,CACjB,CAAC;AAED,AAAI,EAAA,CAAA,SAAQ,EAAI,GAAC,CAAC;AAElB,AAAI,EAAA,CAAA,SAAQ,EAAI,EAAC,CAAC,WAAU,GAAK,CAAA,QAAO,gBAAgB,MAAM,CAAC,CAAC;AAChE,AAAI,EAAA,CAAA,SAAQ,EAAI,CAAA,SAAQ,EAAI,kBAAgB,EAAI,YAAU,CAAC;AAC3D,AAAI,EAAA,CAAA,aAAY,EAAI,CAAA,SAAQ,EAAI,sBAAoB,EAAI,gBAAc,CAAC;AACvE,AAAI,EAAA,CAAA,YAAW,EAAI,CAAA,SAAQ,EAAI,qBAAmB,EAAI,eAAa,CAAC;AACpE,AAAI,EAAA,CAAA,aAAY,EAAI,CAAA,SAAQ,EAAI,sBAAoB,EAAI,gBAAc,CAAC;AAEvE,OAAS,WAAS,CAAE,GAAE,CAAG,CAAA,CAAA,CAAG,CAAA,CAAA,CAAG;AAC7B,IAAE,MAAM,KAAK,EAAI,CAAA,CAAA,EAAI,UAAQ,CAAA,CAAI,KAAG,CAAC;AACrC,IAAE,MAAM,IAAI,EAAI,CAAA,CAAA,EAAI,UAAQ,CAAA,CAAI,KAAG,CAAC;AACtC;AAAA,AAEA,OAAS,QAAM,CAAE,MAAK,CAAG;AACvB,OAAO,CAAA,MAAK,WAAa,MAAI,CAAC;AAChC;AAAA,AAEA,OAAS,QAAM,CAAE,IAAG,CAAG;AACrB,OAAO,CAAA,KAAI,QAAQ,AAAC,CAAC,IAAG,CAAC,CA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AAAA,CAAA,CAAC;AAC/D,OAAO,eAAe,AAAC,CAAC,MAAK,CAAC,QAAQ,IAAI,SAAC,AAAD;OAAM,CAAA,KAAI,KAAK,AAAC,EAAC;AAAA,CAAA,CAAC;AAC5D,OAAO,eAAe,AAAC,CAAC,OAAM,CAAC,QAAQ,IAAI,SAAC,AAAD;OAAM,CAAA,KAAI,MAAM,AAAC,EAAC;AAAA,CAAA,CAAC;AAE9D,KAAK,iBAAiB,AAAC,CAAC,YAAW,CAAG,UAAQ,CAAC,CAAC","file":"/Users/arv/src/jelly/jelly.js","sourcesContent":["'use strict';\n\nvar levels = [\n `xxxxxxxxxxxxxx\n x x\n x x\n x x\n x x\n x r x\n x xx x\n x g r b x\n xxbxxxg xxxxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x x\n x x\n x x\n x x\n x g g x\n x r r r x\n xxxxx x x xxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x x\n x x\n x x\n x bg x g x\n xxx xxxrxxx x\n x b x\n xxx xxxrxxxxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x r x\n x b x\n x x x\n x b r x\n x b r b x\n xxx x xxx\n xxxxx xxxxxxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x x\n xrg gg x\n xxx xxxx xx x\n xrg x\n xxxxx xx xx\n xxxxxx xx xxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n xxxxxxx x\n xxxxxxx g x\n x xx x\n x r b x\n x x xxx x g x\n x x bx\n x r xxxx\n x xxxxxxxxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x r x\n x x x\n x b b x\n x x rr x\n x x x\n x R Bx x x x\n x x xx x x x\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n xxx x x xx\n xx g b xx\n xx x x xx\n xx B G xx\n xxg bxx\n xxxg bxxx\n xxxx xxxx\n xxxxxxxxxxxxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x x\n x x\n x x\n x x\n x rbx\n x x xxx\n xb 11xx\n xx Rx x xxxx\n xxxxxxxxxxxxxx`,\n\n `xxxxxxxxxxxxxx\n x gr x\n x 11 2 x\n x x x x\n x x\n x x x x\n x x rx\n xx x gxx\n x xxx\n xxxxxxxxxxxxxx`,\n];\n\nvar CELL_SIZE = 48;\n\nvar oldWebKit = !('animation' in document.documentElement.style);\nvar animation = oldWebKit ? 'webkitAnimation' : 'animation';\nvar animationName = oldWebKit ? 'webkitAnimationName' : 'animationName';\nvar animationEnd = oldWebKit ? 'webkitAnimationEnd' : 'animationend';\nvar transitionEnd = oldWebKit ? 'webkitTransitionEnd' : 'transitionend';\n\nfunction moveToCell(dom, x, y) {\n dom.style.left = x * CELL_SIZE + 'px';\n dom.style.top = y * CELL_SIZE + 'px';\n}\n\nfunction isJelly(object) {\n return object instanceof Jelly;\n}\n\nfunction isFixed(kind) {\n return 'RGB'.indexOf(kind) >= 0;\n}\n\nfunction getColor(kind) {\n switch (kind) {\n case 'r':\n case 'R':\n return 'red';\n case 'g':\n case 'G':\n return 'green';\n case 'b':\n case 'B':\n return 'blue';\n case '1':\n case '2':\n return 'black';\n }\n}\n\nclass Stage {\n constructor(dom, map) {\n this.dom = dom;\n\n // Capture and swallow all click events during animations.\n this.busy = false;\n\n this.loadMap(map);\n }\n\n loadMap(map) {\n this.undoStack = [];\n this.jellies = [];\n this.dom.textContent = '';\n\n var table = document.createElement('table');\n this.dom.appendChild(table);\n var lines = map.trim().split(/\\s*\\n\\s*/);\n this.cells = lines.map((line, y) => {\n var row = line.split('');\n var tr = document.createElement('tr');\n table.appendChild(tr);\n return row.map((char, x) => {\n if (row[x] === 'x') {\n var wall = document.createElement('td');\n wall.className = 'cell wall';\n tr.appendChild(wall);\n return wall;\n }\n\n var td = document.createElement('td');\n td.className = 'transparent';\n tr.appendChild(td);\n\n if (row[x] !== ' ') {\n var jelly = new Jelly(this, x, y, row[x]);\n this.dom.appendChild(jelly.dom);\n this.jellies.push(jelly);\n return jelly;\n }\n\n return null;\n });\n });\n this.addBorders();\n this.addLocks();\n\n this.checkForMerges();\n }\n\n addBorders() {\n for (var y = 0; y < this.cells.length; y++) {\n for (var x = 0; x < this.cells[0].length; x++) {\n var cell = this.cells[y][x];\n if (!cell || cell.tagName != 'TD') {\n continue;\n }\n var border = 'solid 1px #777';\n var edges = [\n ['borderBottom', 0, 1],\n ['borderTop', 0, -1],\n ['borderLeft', -1, 0],\n ['borderRight', 1, 0],\n ];\n for (var [attr, dx, dy] of edges) {\n if (y + dy < 0 || y + dy >= this.cells.length) {\n continue;\n }\n if (x + dx < 0 || x + dx >= this.cells[0].length) {\n continue;\n }\n var other = this.cells[y + dy][x + dx];\n if (!other || other.tagName != 'TD') {\n cell.style[attr] = border;\n }\n }\n }\n }\n }\n\n addLocks() {\n for (var jelly of this.jellies) {\n if (jelly.isFixed) {\n jelly.addLock();\n }\n }\n }\n\n waitForAnimation(cb) {\n var end = () => {\n this.dom.removeEventListener(transitionEnd, end);\n cb();\n };\n this.dom.addEventListener(transitionEnd, end);\n }\n\n trySlide(jelly, dir) {\n if (!this.canMove(jelly, dir)) {\n return;\n }\n\n this.saveState();\n\n this.busy = true;\n var jellies = this.getAdjacentObjects(jelly, dir).filter(isJelly);\n jellies.reverse().forEach(jelly => {\n this.move(jelly, dir, 0);\n });\n\n this.waitForAnimation(() => {\n this.checkFall(() => {\n this.checkForMerges();\n this.busy = false;\n });\n });\n }\n\n move(jelly, dx, dy) {\n var targetX = jelly.x + dx;\n var targetY = jelly.y + dy;\n for (var [x, y] of jelly.cellCoords()) {\n this.cells[y][x] = null;\n }\n jelly.updatePosition(targetX, targetY);\n for (var [x, y] of jelly.cellCoords()) {\n this.cells[y][x] = jelly;\n }\n }\n\n isWallAt(x, y) {\n return this.cells[y][x] != null && !isJelly(this.cells[y][x]);\n }\n\n checkFilled(jelly, dx, dy) {\n for (var [x, y] of jelly.cellCoords()) {\n var next = this.cells[y + dy][x + dx];\n if (next && next != jelly) {\n return next;\n }\n }\n return false;\n }\n\n canMove(jelly, dir) {\n if (jelly.isFixed) {\n return false;\n }\n for (var object of this.getAdjacentObjects(jelly, dir)) {\n // TODO: The wall should be objects too.\n if (!isJelly(object) || object.isFixed) {\n return false;\n }\n // TODO: Check if jelly is fixed (needed for later levels)\n }\n return true;\n }\n\n /**\n * Returns the jellies and walls that are touching in the given direction.\n * Including the jelly passed as argument.\n */\n getAdjacentObjects(jelly, dir) {\n // ES6 has Set but Traceur does not provide a polyfill at this time.\n var found = [];\n\n var inner = jelly => {\n found.push(jelly);\n for (var [x, y] of jelly.cellCoords()) {\n var next = this.cells[y][x + dir];\n if (next && next != jelly && found.indexOf(next) == -1) {\n if (isJelly(next)) {\n inner(next);\n }\n // wall\n else {\n found.push(next);\n }\n }\n }\n };\n\n inner(jelly);\n return found;\n }\n\n checkFall(cb) {\n var moved = false;\n var didOneMove = true;\n while (didOneMove) {\n didOneMove = false;\n for (var jelly of this.jellies) {\n if (!jelly.isFixed && !this.checkFilled(jelly, 0, 1)) {\n this.move(jelly, 0, 1);\n moved = true;\n didOneMove = true;\n }\n }\n }\n if (moved) {\n this.waitForAnimation(cb);\n } else {\n cb();\n }\n }\n\n checkForMerges() {\n var jelly;\n while ((jelly = this.doOneMerge())) {\n for (var [x, y] of jelly.cellCoords()) {\n this.cells[y][x] = jelly;\n }\n }\n this.checkForCompletion();\n }\n\n get done() {\n return this._done;\n }\n\n checkForCompletion() {\n var kinds = {};\n for (var jelly of this.jellies) {\n kinds[jelly.kind] = true;\n }\n\n var done = Object.keys(kinds).length === this.jellies.length;\n if (done != this._done) {\n this._done = done;\n if (this.onDoneChange) {\n this.onDoneChange();\n }\n }\n }\n\n doOneMerge() {\n for (var jelly of this.jellies) {\n for (var [x, y] of jelly.cellCoords()) {\n // Only look right and down; left and up are handled by that side\n // itself looking right and down.\n for (var [dx, dy] of [\n [1, 0],\n [0, 1],\n ]) {\n var other = this.cells[y + dy][x + dx];\n if (!other || !isJelly(other)) {\n continue;\n }\n if (other == jelly) {\n continue;\n }\n if (jelly.kind != other.kind) {\n continue;\n }\n jelly.merge(other);\n this.jellies = this.jellies.filter(j => j != other);\n return jelly;\n }\n }\n }\n return null;\n }\n\n saveState() {\n var rows = [];\n for (var row of this.cells) {\n var s = '';\n for (var cell of row) {\n if (isJelly(cell)) {\n s += cell.kind;\n } else if (cell) {\n s += 'x';\n } else {\n s += ' ';\n }\n }\n rows.push(s);\n }\n this.undoStack.push(rows.join('\\n'));\n }\n\n get canUndo() {\n return this.undoStack.length > 0;\n }\n\n undo() {\n var state = this.undoStack.pop();\n if (!state) {\n return;\n }\n var undoStack = this.undoStack;\n this.loadMap(state);\n this.undoStack = undoStack;\n }\n\n reset() {\n var state = this.undoStack[0];\n if (!state) {\n return;\n }\n this.loadMap(state);\n }\n}\n\nclass JellyCell {\n constructor(jelly, x, y, color) {\n this.jelly = jelly;\n this.x = x;\n this.y = y;\n this.dom = document.createElement('div');\n this.dom.className = 'cell jelly ' + color;\n }\n}\n\nclass Jelly {\n constructor(stage, x, y, kind) {\n this.stage = stage;\n this.x = x;\n this.y = y;\n var color = getColor(kind);\n this.isFixed = isFixed(kind);\n this.kind = kind.toLowerCase();\n this.dom = document.createElement('div');\n this.updatePosition(this.x, this.y);\n this.dom.className = 'cell jellybox';\n\n var cell = new JellyCell(this, 0, 0, color);\n this.dom.appendChild(cell.dom);\n this.cells = [cell];\n\n this.dom.addEventListener('pointerdown', e => {\n var pointerId = e.pointerId;\n var startX = e.clientX;\n\n var move = e => {\n e.preventDefault();\n if (e.pointerId !== pointerId) {\n return;\n }\n\n var distance = Math.abs(e.clientX - startX);\n if (this.stage.busy || distance < 24) {\n return;\n }\n\n var dir = e.clientX - startX < 0 ? -1 : 1;\n stage.trySlide(this, dir);\n startX += dir * 48;\n };\n\n var doc = this.dom.ownerDocument;\n var end = () => {\n if (e.pointerId !== pointerId) {\n return;\n }\n\n doc.removeEventListener('pointermove', move, true);\n doc.removeEventListener('pointerup', end, true);\n };\n\n doc.addEventListener('pointermove', move, true);\n doc.addEventListener('pointerup', end, true);\n e.preventDefault();\n });\n }\n\n cellCoords() {\n return this.cells.map(cell => [this.x + cell.x, this.y + cell.y]);\n }\n\n slide(dir, cb) {\n var end = () => {\n this.dom.style[animation] = '';\n this.dom.removeEventListener(animationEnd, end);\n cb();\n };\n this.dom.addEventListener(animationEnd, end);\n this.dom.style[animation] = '300ms ease-out';\n if (dir == 1) {\n this.dom.style[animationName] = 'slideRight';\n } else {\n this.dom.style[animationName] = 'slideLeft';\n }\n }\n\n updatePosition(x, y) {\n this.x = x;\n this.y = y;\n moveToCell(this.dom, this.x, this.y);\n }\n\n merge(other) {\n // Reposition other's cells as children of this jelly.\n var dx = other.x - this.x;\n var dy = other.y - this.y;\n for (var cell of other.cells) {\n this.cells.push(cell);\n cell.x += dx;\n cell.y += dy;\n moveToCell(cell.dom, cell.x, cell.y);\n this.dom.appendChild(cell.dom);\n }\n\n // Delete references from/to other.\n other.cells = null;\n other.dom.parentNode.removeChild(other.dom);\n\n // Remove internal borders.\n for (var cell of this.cells) {\n for (var othercell of this.cells) {\n if (othercell == cell) {\n continue;\n }\n if (othercell.x == cell.x + 1 && othercell.y == cell.y)\n cell.dom.style.borderRight = 'none';\n else if (othercell.x == cell.x - 1 && othercell.y == cell.y)\n cell.dom.style.borderLeft = 'none';\n else if (othercell.x == cell.x && othercell.y == cell.y + 1)\n cell.dom.style.borderBottom = 'none';\n else if (othercell.x == cell.x && othercell.y == cell.y - 1)\n cell.dom.style.borderTop = 'none';\n }\n }\n\n this.isFixed = this.isFixed || other.isFixed;\n }\n\n addLock() {\n var lock = document.createElement('div');\n this.cells[0].dom.appendChild(lock);\n var stage = this.stage;\n var lockDir = 'above';\n if (stage.isWallAt(this.x, this.y - 1)) {\n lockDir = 'above';\n } else if (stage.isWallAt(this.x, this.y + 1)) {\n lockDir = 'below';\n } else if (stage.isWallAt(this.x - 1, this.y)) {\n lockDir = 'left';\n } else {\n lockDir = 'right';\n }\n\n lock.className = `lock ${lockDir}`;\n }\n}\n\nvar stage = null; // Safari bug. Needs assignment to shadow element with ID.\n\nfunction loadLevel() {\n var level = +location.hash.slice(1) || 0;\n if (!stage) {\n stage = new Stage(document.getElementById('map'), levels[level]);\n } else {\n stage.loadMap(levels[level]);\n }\n\n levelPicker.value = level;\n}\n\nfunction loadNextLevel() {\n var level = +levelPicker.value + 1;\n if (level >= levels.length) {\n level = 0;\n }\n location.hash = level;\n loadLevel();\n}\n\nvar levelPicker = document.getElementById('level');\nlevelPicker.addEventListener('change', () => {\n location.hash = levelPicker.value;\n});\nfor (var i = 0; i < levels.length; i++) {\n var option = new Option(`Level ${i + 1}`, i);\n levelPicker.appendChild(option);\n}\n\nloadLevel();\n\nstage.onDoneChange = () => {\n document.getElementById('done').style.display = stage.done ? 'block' : '';\n};\n\ndocument.getElementById('done').onclick = () => loadNextLevel();\ndocument.getElementById('undo').onclick = () => stage.undo();\ndocument.getElementById('reset').onclick = () => stage.reset();\n\nwindow.addEventListener('hashchange', loadLevel);\n"]}