Code edit (1 edits merged)
Please save this source code
User prompt
for entrance anim, Adjust tile placement to include negative x and y
User prompt
fix `Place tiles randomly out of the screen` because not tiles come from top or left of the screen
User prompt
``` // Place tiles randomly out of the screen tile.x = Math.random() * 2048; tile.y = Math.random() * 2732; ``` should also places tiles at -tile.width and -tile.height to cover all screen borders, not only right and bottom
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'animateTilesEntrance')' in or related to this line: 'self.animateTilesEntrance = function () {' Line Number: 248
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'animateTilesEntrance')' in or related to this line: 'self.animateTilesEntrance = function () {' Line Number: 885
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'animateTilesEntrance')' in or related to this line: 'self.animateTilesEntrance = function () {' Line Number: 885
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'animateTilesEntrance')' in or related to this line: 'self.animateTilesEntrance = function () {' Line Number: 885
User prompt
Please fix the bug: 'self.animateTilesEntrance is not a function' in or related to this line: 'self.animateTilesEntrance();' Line Number: 288
User prompt
in loadLevel after `self.createOperations();` call an new function animateTilesEntrance(). in this function follow the folowing scenario: - place tiles randomly out of the screen - make them visible - then animate their move to their baseX, baseY
Code edit (6 edits merged)
Please save this source code
User prompt
rework the code to simplify operations in levelConfigs: for example instead of `operations: [{ type: '-1', uses: 2 }, { type: '-2', uses: 1 }]` simplify into `operations: ['-1', '-1', '-2']` (remove the 'uses' notion)
Code edit (1 edits merged)
Please save this source code
User prompt
in createOperations, when there are more than 3 operations, place operations after the 3rd at y = baseY-200
Code edit (15 edits merged)
Please save this source code
User prompt
in createBoard() loop, determine the maxTilesInRow
User prompt
in (), determine maxTilesInRow
User prompt
in createBoard(), add a local variable to track largest number of tiles in the level rows
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
in isPointInsideTile, decompose overlapOffset into overlapOffsetX and overlapOffsetY
Code edit (4 edits merged)
Please save this source code
User prompt
in PuzzleManager reset(), remove all existing tiles and operations before loading level
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -230,43 +230,11 @@
/****
* Game Code
****/
-// Transition to menu state
-/***********************************************************************************************/
/************************************* GAME OBJECTS CLASSES ************************************/
-function _toConsumableArray(r) {
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray2(r) || _nonIterableSpread();
-}
-function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-function _unsupportedIterableToArray2(r, a) {
- if (r) {
- if ("string" == typeof r) {
- return _arrayLikeToArray2(r, a);
- }
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, a) : void 0;
- }
-}
-function _iterableToArray(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) {
- return Array.from(r);
- }
-}
-function _arrayWithoutHoles(r) {
- if (Array.isArray(r)) {
- return _arrayLikeToArray2(r);
- }
-}
-function _arrayLikeToArray2(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) {
- n[e] = r[e];
- }
- return n;
-}
+/***********************************************************************************************/
+// Transition to menu state
function PuzzleManager(game) {
var self = this;
// Properties
self.game = game;
@@ -309,18 +277,15 @@
self.createOperations();
};
self.createBoard = function () {
self.board = [];
- var maxTilesInRow = Math.max.apply(Math, _toConsumableArray(self.levelData.tiles.map(function (row) {
- return row.filter(function (tile) {
- return tile !== "";
- }).length;
- }))); // Determine the maximum number of tiles in any row
+ var maxTilesInRow = 0; // Local variable to track the largest number of tiles in the level rows
self.activeTileCount = 0; // Reset active tile count
// Update levelBoardOffsets depending on level
self.levelBoardOffsetX = 500; // largest row = 3 => 300
self.levelBoardOffsetY = 150;
for (var row = 0; row < self.levelData.tiles.length; row++) {
+ maxTilesInRow = Math.max(maxTilesInRow, self.levelData.tiles[row].length);
for (var col = 0; col < self.levelData.tiles[row].length; col++) {
var value = self.levelData.tiles[row][col];
if (value !== "") {
var tile = new HexTile(value, col, row, self.levelData, self.levelBoardOffsetX, self.levelBoardOffsetY);
tick
Sound effect
tileEntrance
Sound effect
tileRemove
Sound effect
operationSelect
Sound effect
operationCancel
Sound effect
tileChangeValue
Sound effect
resetSound
Sound effect
levelFailed
Sound effect
menuLevelSelect
Sound effect
menuCellEnter
Sound effect
applause
Sound effect
bgMusic
Music
tada
Sound effect