User prompt
Ana ekranın sol altında kod yazın diye bir bölüm olsun oraya tıklayınca kod yazın diye bir eğe ro bölgeye "11012012" yazarsak bize 300 altın versin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Mor bombanın içinde 5 tane normal bomba çıksın ve onları rastgele fırlatsın ama bombalar mor bombanın 5×5 alanını patlasın ve sarı bomba patladığı yere yeşil bir iz bıraksın eğer hangi skorda olduysa o skor 1000 fazlası olduğunda leke kalksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyunda %0,1 İhtimal ile Sarı Bomba Oluşsun bu bomba TÜM topları yok etsin ve 10000 puan yazsın oyun 15000 puanda bitsin ve eğer oyunu bitirirsem bize 20 altın versin ve 100 altın ile tüm toplara kral tacı eklensin ana ekranda sağ üstte market yazsın oraya tıklayınca o market ekranın sağ üstünde yeşil yazıyla tüm karakterlere kral tacı yazsın altında 100 altın yazsın eğer 100 altın yazan yere tıklarsanız paramız gitsin ve bütün toplara kral tacı eklensin ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Mor bombanın oluşma ihtimalini %1 yap
User prompt
Duvarlar hareket ettirilemez olsun ve oyun başında siyah bur ekran olsun ekranda "duyguları vur" yazsın altında oyna yazsın eğer oyna butonuna basarsak oyunu başlatsın ve oynamaya başlayalım ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'ReferenceError: checkForStuckBalls is not defined' in or related to this line: 'checkForStuckBalls();' Line Number: 979
User prompt
Please fix the bug: 'ReferenceError: checkForStuckBalls is not defined' in or related to this line: 'checkForStuckBalls();' Line Number: 983
User prompt
Rastgele bir zamanda mor bir bomba olsun 5×5 alanda her şeyi yok etsin duvarlar dahil ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Duvarlarda eğer toplar sıkışır ise o bölgeye bir bomba oluştur ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Eğer 122 adet duvar oluşursa ekranda kazandın yazıp altında tekrar oyna yazsın ve en altta :eğer oyunumu beğendiysen yeni oyunlar gelicek" yazsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Her 100 puanda rastgele 5 yere duvar çıksın ve o duvar patlamasın
User prompt
Emojileri biraz büyült
User prompt
Eğer 5 top eşleşirse kırmızı bir bomba oluşsun ve eğer o bomba bir top ile yer değişirse 7×7 bir alanda patlama yapsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot use 'in' operator to search for 'alpha' in null' in or related to this line: 'tween(self.glowEffect, {' Line Number: 126 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyun alanını ve topların görüntüsünü büyülü ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Topları diğer toplar ile yer değiştirebililim
Code edit (1 edits merged)
Please save this source code
User prompt
Bomb Blast Match
Initial prompt
Bana 15×15 alanda farklı renklerde toplar oluştur her toplar 3 tanesi yandan veya yukarıdan eşleşirse 10 puan versin rastgele bir zamanda bomba gelsin o bomba başka bir top ile yerini değiştirirsen 3×3 alanda patlasın topları hareket ettirebilelim
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var GridCell = Container.expand(function (row, col) { var self = Container.call(this); self.row = row; self.col = col; self.ballType = null; self.ball = null; self.isBomb = false; var cellBg = self.attachAsset('grid_cell', { anchorX: 0.5, anchorY: 0.5 }); self.setBall = function (ballType) { if (self.ball) { self.removeChild(self.ball); } if (self.glowEffect) { self.removeChild(self.glowEffect); self.glowEffect = null; } if (ballType === 'bomb') { self.ball = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.isBomb = true; self.ballType = 'bomb'; // Add magical pulsing effect to bomb tween(self.ball, { scaleX: 1.2, scaleY: 1.2 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { tween(self.ball, { scaleX: 1.0, scaleY: 1.0 }, { duration: 800, easing: tween.easeInOut }); } }); } else if (ballType) { // Add glow effect behind the ball self.glowEffect = self.attachAsset('glow_effect', { anchorX: 0.5, anchorY: 0.5 }); self.glowEffect.alpha = 0.3; self.glowEffect.tint = self.getBallColor(ballType); // Add the main ball self.ball = self.attachAsset('ball_' + ballType, { anchorX: 0.5, anchorY: 0.5 }); self.isBomb = false; self.ballType = ballType; // Add sparkle entrance effect self.ball.scaleX = 0; self.ball.scaleY = 0; tween(self.ball, { scaleX: 1, scaleY: 1 }, { duration: 400, easing: tween.elasticOut }); // Add continuous gentle glow pulsing self.startGlowAnimation(); } else { self.ball = null; self.ballType = null; self.isBomb = false; } }; self.down = function (x, y, obj) { if (self.ball) { selectedCell = self; } }; self.getBallColor = function (ballType) { var colors = { 'red': 0xff4444, 'blue': 0x4444ff, 'green': 0x44ff44, 'yellow': 0xffff44, 'purple': 0xff44ff, 'orange': 0xff8844 }; return colors[ballType] || 0xffffff; }; self.startGlowAnimation = function () { if (self.glowEffect) { var _pulseGlow = function pulseGlow() { if (self.glowEffect) { tween(self.glowEffect, { alpha: 0.6 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { if (self.glowEffect) { tween(self.glowEffect, { alpha: 0.3 }, { duration: 1500, easing: tween.easeInOut, onFinish: _pulseGlow }); } } }); } }; _pulseGlow(); } }; self.createSparkles = function () { for (var i = 0; i < 5; i++) { var sparkle = self.attachAsset('sparkle', { anchorX: 0.5, anchorY: 0.5 }); sparkle.x = (Math.random() - 0.5) * 80; sparkle.y = (Math.random() - 0.5) * 80; sparkle.alpha = 0.8; sparkle.scaleX = 0.5; sparkle.scaleY = 0.5; tween(sparkle, { x: sparkle.x + (Math.random() - 0.5) * 100, y: sparkle.y + (Math.random() - 0.5) * 100, alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { if (sparkle.parent) { sparkle.parent.removeChild(sparkle); } } }); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x222222 }); /**** * Game Code ****/ var GRID_SIZE = 15; var CELL_SIZE = 126; var BALL_COLORS = ['red', 'blue', 'green', 'yellow', 'purple', 'orange']; var GRID_START_X = (2048 - GRID_SIZE * CELL_SIZE) / 2; var GRID_START_Y = 300; var grid = []; var selectedCell = null; var isAnimating = false; var bombSpawnCounter = 0; // Create score display var scoreTxt = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Initialize grid function initializeGrid() { for (var row = 0; row < GRID_SIZE; row++) { grid[row] = []; for (var col = 0; col < GRID_SIZE; col++) { var cell = new GridCell(row, col); cell.x = GRID_START_X + col * CELL_SIZE + CELL_SIZE / 2; cell.y = GRID_START_Y + row * CELL_SIZE + CELL_SIZE / 2; var randomColor = BALL_COLORS[Math.floor(Math.random() * BALL_COLORS.length)]; cell.setBall(randomColor); grid[row][col] = cell; game.addChild(cell); } } } // Get random ball color function getRandomBallColor() { return BALL_COLORS[Math.floor(Math.random() * BALL_COLORS.length)]; } // Check if two cells are adjacent function areAdjacent(cell1, cell2) { var rowDiff = Math.abs(cell1.row - cell2.row); var colDiff = Math.abs(cell1.col - cell2.col); return rowDiff === 1 && colDiff === 0 || rowDiff === 0 && colDiff === 1; } // Swap balls between two cells function swapBalls(cell1, cell2) { var tempType = cell1.ballType; var tempIsBomb = cell1.isBomb; cell1.setBall(cell2.ballType); cell2.setBall(tempType); } // Check for matches starting from a specific cell function checkMatches() { var matchedCells = []; var visited = []; for (var row = 0; row < GRID_SIZE; row++) { visited[row] = []; for (var col = 0; col < GRID_SIZE; col++) { visited[row][col] = false; } } // Check horizontal matches for (var row = 0; row < GRID_SIZE; row++) { for (var col = 0; col < GRID_SIZE - 2; col++) { var cell = grid[row][col]; if (!cell.ball || cell.isBomb || visited[row][col]) continue; var matchCount = 1; var matchCells = [cell]; for (var c = col + 1; c < GRID_SIZE; c++) { var nextCell = grid[row][c]; if (nextCell.ball && !nextCell.isBomb && nextCell.ballType === cell.ballType) { matchCount++; matchCells.push(nextCell); } else { break; } } if (matchCount >= 3) { for (var i = 0; i < matchCells.length; i++) { matchedCells.push(matchCells[i]); visited[matchCells[i].row][matchCells[i].col] = true; } } } } // Check vertical matches for (var col = 0; col < GRID_SIZE; col++) { for (var row = 0; row < GRID_SIZE - 2; row++) { var cell = grid[row][col]; if (!cell.ball || cell.isBomb || visited[row][col]) continue; var matchCount = 1; var matchCells = [cell]; for (var r = row + 1; r < GRID_SIZE; r++) { var nextCell = grid[r][col]; if (nextCell.ball && !nextCell.isBomb && nextCell.ballType === cell.ballType) { matchCount++; matchCells.push(nextCell); } else { break; } } if (matchCount >= 3) { for (var i = 0; i < matchCells.length; i++) { if (!visited[matchCells[i].row][matchCells[i].col]) { matchedCells.push(matchCells[i]); visited[matchCells[i].row][matchCells[i].col] = true; } } } } } return matchedCells; } // Remove matched balls and update score function removeMatches(matchedCells) { if (matchedCells.length === 0) return; LK.setScore(LK.getScore() + matchedCells.length * 10); scoreTxt.setText('Score: ' + LK.getScore()); for (var i = 0; i < matchedCells.length; i++) { // Create sparkle effect before removing matchedCells[i].createSparkles(); // Add magical disappear animation if (matchedCells[i].ball) { tween(matchedCells[i].ball, { scaleX: 0, scaleY: 0, alpha: 0 }, { duration: 300, easing: tween.easeIn }); } if (matchedCells[i].glowEffect) { tween(matchedCells[i].glowEffect, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 300, easing: tween.easeOut }); } // Remove after animation LK.setTimeout(function (cell) { return function () { cell.setBall(null); }; }(matchedCells[i]), 300); } LK.getSound('match').play(); } // Explode bomb in 3x3 area function explodeBomb(centerRow, centerCol) { var clearedCells = []; // Create magical explosion wave effect var explosionCenter = grid[centerRow][centerCol]; for (var row = Math.max(0, centerRow - 1); row <= Math.min(GRID_SIZE - 1, centerRow + 1); row++) { for (var col = Math.max(0, centerCol - 1); col <= Math.min(GRID_SIZE - 1, centerCol + 1); col++) { var cell = grid[row][col]; if (cell.ball) { clearedCells.push(cell); // Create magical explosion effect var distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(col - centerCol, 2)); var delay = distance * 100; // Stagger the explosions LK.setTimeout(function (targetCell) { return function () { targetCell.createSparkles(); if (targetCell.ball) { // Create explosive scale effect tween(targetCell.ball, { scaleX: 1.5, scaleY: 1.5 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { tween(targetCell.ball, { scaleX: 0, scaleY: 0, alpha: 0 }, { duration: 200, easing: tween.easeIn }); } }); } if (targetCell.glowEffect) { tween(targetCell.glowEffect, { scaleX: 3, scaleY: 3, alpha: 0 }, { duration: 350, easing: tween.easeOut }); } LK.setTimeout(function () { targetCell.setBall(null); }, 350); }; }(cell), delay); } } } LK.setScore(LK.getScore() + clearedCells.length * 5); scoreTxt.setText('Score: ' + LK.getScore()); LK.getSound('bomb_explode').play(); } // Drop balls down to fill empty spaces function dropBalls() { var moved = false; for (var col = 0; col < GRID_SIZE; col++) { for (var row = GRID_SIZE - 1; row >= 0; row--) { if (!grid[row][col].ball) { // Find the first ball above this empty space for (var r = row - 1; r >= 0; r--) { if (grid[r][col].ball) { grid[row][col].setBall(grid[r][col].ballType); grid[r][col].setBall(null); moved = true; break; } } } } } return moved; } // Fill empty spaces at the top with new balls function fillEmptySpaces() { for (var col = 0; col < GRID_SIZE; col++) { for (var row = 0; row < GRID_SIZE; row++) { if (!grid[row][col].ball) { var randomColor = getRandomBallColor(); grid[row][col].setBall(randomColor); // Add magical appearance delay based on position var delay = row * 50 + Math.random() * 100; if (grid[row][col].ball) { grid[row][col].ball.alpha = 0; grid[row][col].ball.y -= 50; LK.setTimeout(function (cell) { return function () { if (cell.ball) { tween(cell.ball, { alpha: 1, y: cell.ball.y + 50 }, { duration: 400, easing: tween.bounceOut }); } }; }(grid[row][col]), delay); } } } } } // Spawn a random bomb on the grid function spawnBomb() { var emptyCells = []; for (var row = 0; row < GRID_SIZE; row++) { for (var col = 0; col < GRID_SIZE; col++) { if (grid[row][col].ball && !grid[row][col].isBomb) { emptyCells.push(grid[row][col]); } } } if (emptyCells.length > 0) { var randomCell = emptyCells[Math.floor(Math.random() * emptyCells.length)]; randomCell.setBall('bomb'); } } // Clear previous selection visual feedback function clearSelectionTint() { if (selectedCell && selectedCell.ball) { selectedCell.ball.tint = 0xffffff; } } // Handle cell selection and swapping game.down = function (x, y, obj) { if (isAnimating) return; // Find clicked cell for (var row = 0; row < GRID_SIZE; row++) { for (var col = 0; col < GRID_SIZE; col++) { var cell = grid[row][col]; var cellPos = game.toLocal(cell.parent.toGlobal(cell.position)); var distance = Math.sqrt(Math.pow(x - cellPos.x, 2) + Math.pow(y - cellPos.y, 2)); if (distance < CELL_SIZE / 2 && cell.ball) { if (!selectedCell) { selectedCell = cell; // Tint the selected ball to show it's selected if (selectedCell.ball) { selectedCell.ball.tint = 0xaaaaaa; } } else if (selectedCell === cell) { // Deselect current cell clearSelectionTint(); selectedCell = null; } else if (areAdjacent(selectedCell, cell)) { // Clear selection tint before swapping clearSelectionTint(); // Handle bomb explosion if (selectedCell.isBomb) { explodeBomb(cell.row, cell.col); selectedCell.setBall(null); } else if (cell.isBomb) { explodeBomb(selectedCell.row, selectedCell.col); cell.setBall(null); } else { // Regular swap swapBalls(selectedCell, cell); } selectedCell = null; isAnimating = true; // Check for cascading matches LK.setTimeout(function () { processMatches(); }, 100); } else { // Clear previous selection and select new cell clearSelectionTint(); selectedCell = cell; // Tint the newly selected ball if (selectedCell.ball) { selectedCell.ball.tint = 0xaaaaaa; } } break; } } } }; // Process matches and cascades function processMatches() { var matchedCells = checkMatches(); if (matchedCells.length > 0) { removeMatches(matchedCells); LK.setTimeout(function () { dropBalls(); fillEmptySpaces(); LK.setTimeout(function () { processMatches(); // Check for cascade matches }, 200); }, 300); } else { isAnimating = false; } } // Initialize the game initializeGrid(); // Main game loop game.update = function () { bombSpawnCounter++; // Spawn bomb every 600 ticks (10 seconds at 60fps) if (bombSpawnCounter >= 600) { spawnBomb(); bombSpawnCounter = 0; } };
===================================================================
--- original.js
+++ change.js
@@ -100,23 +100,27 @@
};
self.startGlowAnimation = function () {
if (self.glowEffect) {
var _pulseGlow = function pulseGlow() {
- tween(self.glowEffect, {
- alpha: 0.6
- }, {
- duration: 1500,
- easing: tween.easeInOut,
- onFinish: function onFinish() {
- tween(self.glowEffect, {
- alpha: 0.3
- }, {
- duration: 1500,
- easing: tween.easeInOut,
- onFinish: _pulseGlow
- });
- }
- });
+ if (self.glowEffect) {
+ tween(self.glowEffect, {
+ alpha: 0.6
+ }, {
+ duration: 1500,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ if (self.glowEffect) {
+ tween(self.glowEffect, {
+ alpha: 0.3
+ }, {
+ duration: 1500,
+ easing: tween.easeInOut,
+ onFinish: _pulseGlow
+ });
+ }
+ }
+ });
+ }
};
_pulseGlow();
}
};