User prompt
Şimdide klasik şeker sarısını değiştiremiyirum
User prompt
klasik şeker yellow ismin deki assetsi bomba olarak değiştir. 3x3 alan patlatısn
User prompt
Hamle hakkını 30 yap
User prompt
Oyun başlayıb a direkt bazı eşyalar patlıyor. Onu düzelt
User prompt
Karanlık tema ismini Fast Food olarak değiştir
User prompt
Karanlık tema butonu da biraz aşağıda olsun
User prompt
Tema butonu biraz aşağıda olsun başla butonuna girmesin
User prompt
Ana ekranda ki yazıları ve butonları büyüt
User prompt
Oyunun ismini Guna Blast yap
User prompt
Tema değiştir yazan yerde sadece tema yazsın. Başla ve tema yazısını siyah renk yap
User prompt
Boş hamle yaptığımızda da hamle hakkımız gitsin.
User prompt
Klasik temayı seçtğimizde şekerler farklı resim de olacak ve bu şekerlerin resmini assets lerden ayarlayacam ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyuna ana menü ekle. Başla butonu ve tema değiştirme butonu olsun. Tema değiştire basdığımızda 2 tane oyun teması çıksın ve birini seçib başlayalım ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Score 1000 olduğunda kazanalım ve 20 hakkımz olsun
User prompt
Oyuna bomba ekle 3x3 alan patlatsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
2katl daha büyüt objeleri
User prompt
Ekranı büyüt
Code edit (1 edits merged)
Please save this source code
User prompt
Candy Crush Blast
Initial prompt
Candy Crash gibi oyun yap. Nesneleri ittirdikçe patlasın falan
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Candy = Container.expand(function (candyType) {
var self = Container.call(this);
self.candyType = candyType;
self.gridX = 0;
self.gridY = 0;
self.isAnimating = false;
var candyAssets = ['candy_red', 'candy_blue', 'candy_green', 'candy_yellow', 'candy_purple', 'candy_orange', 'candy_bomb'];
var candyGraphics = self.attachAsset(candyAssets[candyType], {
anchorX: 0.5,
anchorY: 0.5
});
self.setGridPosition = function (gridX, gridY) {
self.gridX = gridX;
self.gridY = gridY;
self.x = GRID_START_X + gridX * CELL_SIZE + CELL_SIZE / 2;
self.y = GRID_START_Y + gridY * CELL_SIZE + CELL_SIZE / 2;
};
self.animateToPosition = function (targetX, targetY, duration, onComplete) {
self.isAnimating = true;
tween(self, {
x: targetX,
y: targetY
}, {
duration: duration || 300,
easing: tween.easeOut,
onFinish: function onFinish() {
self.isAnimating = false;
if (onComplete) onComplete();
}
});
};
self.explode = function () {
tween(self, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
self.bombExplode = function () {
tween(self, {
scaleX: 3,
scaleY: 3,
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
self.destroy();
}
});
};
return self;
});
var Grid = Container.expand(function () {
var self = Container.call(this);
self.cells = [];
self.candies = [];
// Create grid cells
for (var y = 0; y < GRID_SIZE; y++) {
self.cells[y] = [];
self.candies[y] = [];
for (var x = 0; x < GRID_SIZE; x++) {
var cell = self.attachAsset('gridCell', {
anchorX: 0.5,
anchorY: 0.5,
x: GRID_START_X + x * CELL_SIZE + CELL_SIZE / 2,
y: GRID_START_Y + y * CELL_SIZE + CELL_SIZE / 2
});
self.cells[y][x] = cell;
self.candies[y][x] = null;
}
}
self.fillGrid = function () {
for (var y = 0; y < GRID_SIZE; y++) {
for (var x = 0; x < GRID_SIZE; x++) {
if (!self.candies[y][x]) {
var candyType = Math.random() < 0.05 ? 6 : Math.floor(Math.random() * 6);
var candy = new Candy(candyType);
candy.setGridPosition(x, y);
self.candies[y][x] = candy;
self.addChild(candy);
}
}
}
};
self.findMatches = function () {
var matches = [];
// Check horizontal matches
for (var y = 0; y < GRID_SIZE; y++) {
var count = 1;
var currentType = self.candies[y][0] ? self.candies[y][0].candyType : -1;
for (var x = 1; x < GRID_SIZE; x++) {
var candyType = self.candies[y][x] ? self.candies[y][x].candyType : -1;
if (candyType === currentType && candyType !== -1) {
count++;
} else {
if (count >= 3) {
for (var i = x - count; i < x; i++) {
matches.push({
x: i,
y: y
});
}
}
count = 1;
currentType = candyType;
}
}
if (count >= 3) {
for (var i = GRID_SIZE - count; i < GRID_SIZE; i++) {
matches.push({
x: i,
y: y
});
}
}
}
// Check vertical matches
for (var x = 0; x < GRID_SIZE; x++) {
var count = 1;
var currentType = self.candies[0][x] ? self.candies[0][x].candyType : -1;
for (var y = 1; y < GRID_SIZE; y++) {
var candyType = self.candies[y][x] ? self.candies[y][x].candyType : -1;
if (candyType === currentType && candyType !== -1) {
count++;
} else {
if (count >= 3) {
for (var i = y - count; i < y; i++) {
matches.push({
x: x,
y: i
});
}
}
count = 1;
currentType = candyType;
}
}
if (count >= 3) {
for (var i = GRID_SIZE - count; i < GRID_SIZE; i++) {
matches.push({
x: x,
y: i
});
}
}
}
return matches;
};
self.removeMatches = function (matches) {
var score = 0;
var bombsToExplode = [];
for (var i = 0; i < matches.length; i++) {
var match = matches[i];
if (self.candies[match.y][match.x]) {
if (self.candies[match.y][match.x].candyType === 6) {
bombsToExplode.push({
x: match.x,
y: match.y
});
}
self.candies[match.y][match.x].explode();
self.candies[match.y][match.x] = null;
score += 10;
}
}
// Handle bomb explosions
for (var b = 0; b < bombsToExplode.length; b++) {
var bomb = bombsToExplode[b];
score += self.explodeBomb(bomb.x, bomb.y);
}
return score;
};
self.explodeBomb = function (bombX, bombY) {
var score = 0;
LK.getSound('bomb_explode').play();
// Create 3x3 explosion around bomb
for (var dy = -1; dy <= 1; dy++) {
for (var dx = -1; dx <= 1; dx++) {
var x = bombX + dx;
var y = bombY + dy;
if (x >= 0 && x < GRID_SIZE && y >= 0 && y < GRID_SIZE) {
if (self.candies[y][x]) {
self.candies[y][x].bombExplode();
self.candies[y][x] = null;
score += 20;
}
}
}
}
return score;
};
self.applyGravity = function () {
var moved = false;
for (var x = 0; x < GRID_SIZE; x++) {
for (var y = GRID_SIZE - 1; y >= 0; y--) {
if (!self.candies[y][x]) {
// Find candy above to fall down
for (var aboveY = y - 1; aboveY >= 0; aboveY--) {
if (self.candies[aboveY][x]) {
self.candies[y][x] = self.candies[aboveY][x];
self.candies[aboveY][x] = null;
self.candies[y][x].gridX = x;
self.candies[y][x].gridY = y;
var targetX = GRID_START_X + x * CELL_SIZE + CELL_SIZE / 2;
var targetY = GRID_START_Y + y * CELL_SIZE + CELL_SIZE / 2;
self.candies[y][x].animateToPosition(targetX, targetY, 300);
moved = true;
break;
}
}
}
}
}
return moved;
};
self.spawnNewCandies = function () {
for (var x = 0; x < GRID_SIZE; x++) {
for (var y = 0; y < GRID_SIZE; y++) {
if (!self.candies[y][x]) {
var candyType = Math.random() < 0.05 ? 6 : Math.floor(Math.random() * 6);
var candy = new Candy(candyType);
candy.x = GRID_START_X + x * CELL_SIZE + CELL_SIZE / 2;
candy.y = GRID_START_Y - CELL_SIZE;
candy.gridX = x;
candy.gridY = y;
self.candies[y][x] = candy;
self.addChild(candy);
var targetY = GRID_START_Y + y * CELL_SIZE + CELL_SIZE / 2;
candy.animateToPosition(candy.x, targetY, 400);
}
}
}
};
self.swapCandies = function (x1, y1, x2, y2) {
var candy1 = self.candies[y1][x1];
var candy2 = self.candies[y2][x2];
if (!candy1 || !candy2) return false;
// Swap in grid
self.candies[y1][x1] = candy2;
self.candies[y2][x2] = candy1;
// Update grid positions
candy1.gridX = x2;
candy1.gridY = y2;
candy2.gridX = x1;
candy2.gridY = y1;
// Animate to new positions
var pos1X = GRID_START_X + x2 * CELL_SIZE + CELL_SIZE / 2;
var pos1Y = GRID_START_Y + y2 * CELL_SIZE + CELL_SIZE / 2;
var pos2X = GRID_START_X + x1 * CELL_SIZE + CELL_SIZE / 2;
var pos2Y = GRID_START_Y + y1 * CELL_SIZE + CELL_SIZE / 2;
candy1.animateToPosition(pos1X, pos1Y, 200);
candy2.animateToPosition(pos2X, pos2Y, 200);
return true;
};
self.getCandyAt = function (x, y) {
var gridX = Math.floor((x - GRID_START_X) / CELL_SIZE);
var gridY = Math.floor((y - GRID_START_Y) / CELL_SIZE);
if (gridX >= 0 && gridX < GRID_SIZE && gridY >= 0 && gridY < GRID_SIZE) {
return {
x: gridX,
y: gridY,
candy: self.candies[gridY][gridX]
};
}
return null;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c1810
});
/****
* Game Code
****/
var GRID_SIZE = 10;
var CELL_SIZE = 200;
var GRID_START_X = (2048 - GRID_SIZE * CELL_SIZE) / 2;
var GRID_START_Y = 600;
var TARGET_SCORE = 800;
var MAX_MOVES = 30;
var currentScore = 0;
var movesLeft = MAX_MOVES;
var gameState = 'playing'; // 'playing', 'processing', 'gameover'
var selectedCandy = null;
var grid = null;
var isProcessing = false;
// UI Elements
var scoreText = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
var movesText = new Text2('Moves: ' + MAX_MOVES, {
size: 60,
fill: 0xFFFFFF
});
movesText.anchor.set(0.5, 0);
movesText.y = 80;
LK.gui.top.addChild(movesText);
var targetText = new Text2('Target: ' + TARGET_SCORE, {
size: 50,
fill: 0xFFFF00
});
targetText.anchor.set(0.5, 0);
targetText.y = 150;
LK.gui.top.addChild(targetText);
// Initialize grid
grid = game.addChild(new Grid());
grid.fillGrid();
// Remove initial matches
LK.setTimeout(function () {
processMatches();
}, 500);
function processMatches() {
isProcessing = true;
var matches = grid.findMatches();
if (matches.length > 0) {
var points = grid.removeMatches(matches);
currentScore += points;
scoreText.setText('Score: ' + currentScore);
LK.getSound('match').play();
LK.setTimeout(function () {
var moved = grid.applyGravity();
LK.setTimeout(function () {
grid.spawnNewCandies();
LK.setTimeout(function () {
processMatches(); // Check for chain reactions
}, 500);
}, 300);
}, 300);
} else {
isProcessing = false;
checkGameState();
}
}
function checkGameState() {
if (currentScore >= TARGET_SCORE) {
LK.showYouWin();
} else if (movesLeft <= 0) {
LK.showGameOver();
}
}
function isAdjacent(x1, y1, x2, y2) {
var dx = Math.abs(x1 - x2);
var dy = Math.abs(y1 - y2);
return dx === 1 && dy === 0 || dx === 0 && dy === 1;
}
game.down = function (x, y, obj) {
if (isProcessing || gameState !== 'playing') return;
var candyInfo = grid.getCandyAt(x, y);
if (candyInfo && candyInfo.candy) {
if (selectedCandy) {
if (selectedCandy.candy === candyInfo.candy) {
// Deselect
selectedCandy.candy.scaleX = 1;
selectedCandy.candy.scaleY = 1;
selectedCandy = null;
} else if (isAdjacent(selectedCandy.x, selectedCandy.y, candyInfo.x, candyInfo.y)) {
// Attempt swap
var oldSelected = selectedCandy;
selectedCandy.candy.scaleX = 1;
selectedCandy.candy.scaleY = 1;
selectedCandy = null;
// Try the swap
grid.swapCandies(oldSelected.x, oldSelected.y, candyInfo.x, candyInfo.y);
LK.getSound('swap').play();
// Check if swap creates matches
LK.setTimeout(function () {
var matches = grid.findMatches();
if (matches.length > 0) {
movesLeft--;
movesText.setText('Moves: ' + movesLeft);
processMatches();
} else {
// Swap back if no matches
grid.swapCandies(candyInfo.x, candyInfo.y, oldSelected.x, oldSelected.y);
}
}, 250);
} else {
// Select new candy
selectedCandy.candy.scaleX = 1;
selectedCandy.candy.scaleY = 1;
selectedCandy = candyInfo;
selectedCandy.candy.scaleX = 1.1;
selectedCandy.candy.scaleY = 1.1;
}
} else {
// Select candy
selectedCandy = candyInfo;
selectedCandy.candy.scaleX = 1.1;
selectedCandy.candy.scaleY = 1.1;
}
} else if (selectedCandy) {
// Deselect
selectedCandy.candy.scaleX = 1;
selectedCandy.candy.scaleY = 1;
selectedCandy = null;
}
};
game.update = function () {
// Game update logic handled by event system and timers
}; ===================================================================
--- original.js
+++ change.js
@@ -11,9 +11,9 @@
self.candyType = candyType;
self.gridX = 0;
self.gridY = 0;
self.isAnimating = false;
- var candyAssets = ['candy_red', 'candy_blue', 'candy_green', 'candy_yellow', 'candy_purple', 'candy_orange'];
+ var candyAssets = ['candy_red', 'candy_blue', 'candy_green', 'candy_yellow', 'candy_purple', 'candy_orange', 'candy_bomb'];
var candyGraphics = self.attachAsset(candyAssets[candyType], {
anchorX: 0.5,
anchorY: 0.5
});
@@ -49,8 +49,21 @@
self.destroy();
}
});
};
+ self.bombExplode = function () {
+ tween(self, {
+ scaleX: 3,
+ scaleY: 3,
+ alpha: 0
+ }, {
+ duration: 300,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ self.destroy();
+ }
+ });
+ };
return self;
});
var Grid = Container.expand(function () {
var self = Container.call(this);
@@ -74,9 +87,9 @@
self.fillGrid = function () {
for (var y = 0; y < GRID_SIZE; y++) {
for (var x = 0; x < GRID_SIZE; x++) {
if (!self.candies[y][x]) {
- var candyType = Math.floor(Math.random() * 6);
+ var candyType = Math.random() < 0.05 ? 6 : Math.floor(Math.random() * 6);
var candy = new Candy(candyType);
candy.setGridPosition(x, y);
self.candies[y][x] = candy;
self.addChild(candy);
@@ -149,18 +162,49 @@
return matches;
};
self.removeMatches = function (matches) {
var score = 0;
+ var bombsToExplode = [];
for (var i = 0; i < matches.length; i++) {
var match = matches[i];
if (self.candies[match.y][match.x]) {
+ if (self.candies[match.y][match.x].candyType === 6) {
+ bombsToExplode.push({
+ x: match.x,
+ y: match.y
+ });
+ }
self.candies[match.y][match.x].explode();
self.candies[match.y][match.x] = null;
score += 10;
}
}
+ // Handle bomb explosions
+ for (var b = 0; b < bombsToExplode.length; b++) {
+ var bomb = bombsToExplode[b];
+ score += self.explodeBomb(bomb.x, bomb.y);
+ }
return score;
};
+ self.explodeBomb = function (bombX, bombY) {
+ var score = 0;
+ LK.getSound('bomb_explode').play();
+ // Create 3x3 explosion around bomb
+ for (var dy = -1; dy <= 1; dy++) {
+ for (var dx = -1; dx <= 1; dx++) {
+ var x = bombX + dx;
+ var y = bombY + dy;
+ if (x >= 0 && x < GRID_SIZE && y >= 0 && y < GRID_SIZE) {
+ if (self.candies[y][x]) {
+ self.candies[y][x].bombExplode();
+ self.candies[y][x] = null;
+ score += 20;
+ }
+ }
+ }
+ }
+ return score;
+ };
self.applyGravity = function () {
var moved = false;
for (var x = 0; x < GRID_SIZE; x++) {
for (var y = GRID_SIZE - 1; y >= 0; y--) {
@@ -187,9 +231,9 @@
self.spawnNewCandies = function () {
for (var x = 0; x < GRID_SIZE; x++) {
for (var y = 0; y < GRID_SIZE; y++) {
if (!self.candies[y][x]) {
- var candyType = Math.floor(Math.random() * 6);
+ var candyType = Math.random() < 0.05 ? 6 : Math.floor(Math.random() * 6);
var candy = new Candy(candyType);
candy.x = GRID_START_X + x * CELL_SIZE + CELL_SIZE / 2;
candy.y = GRID_START_Y - CELL_SIZE;
candy.gridX = x;
Boş renkli düğme. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Pizza. In-Game asset. 2d. High contrast. No shadows
Bomba . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Hamburger. In-Game asset. 2d. High contrast. No shadows
Coca Cola. In-Game asset. 2d. High contrast. No shadows
Döner Shavurma. In-Game asset. 2d. High contrast. No shadows
Oatates kızartması Fast Food. In-Game asset. 2d. High contrast. No shadows
Lahmacun. In-Game asset. 2d. High contrast. No shadows
Basit mavi kare yüz. Burnu kocaman olsun. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Basit ağzı kocaman sarı renkde kare yüz. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Basit turuncu renkde kare yüz. In-Game asset. 2d. High contrast. No shadows
Basit mor renkde kare yüz. Burnu çok küçük, dişleri çok büyük. In-Game asset. 2d. High contrast. No shadows
İki gözü iki kaşı olsun
Düz sade kare duvar. In-Game asset. 2d. High contrast. No shadows
Hacvai Fişek. In-Game asset. 2d. High contrast. No shadows
Renkli süper bomba. In-Game asset. 2d. High contrast. No shadows
Elma. In-Game asset. 2d. High contrast. No shadows
Çiyelek. In-Game asset. 2d. High contrast. No shadows
Portakal. In-Game asset. 2d. High contrast. No shadows
Ananas. In-Game asset. 2d. High contrast. No shadows
Üzüm. In-Game asset. 2d. High contrast. No shadows
Muz. In-Game asset. 2d. High contrast. No shadows
Üzerinde soru işaresi olan renkli sandık. In-Game asset. 2d. High contrast. No shadows