User prompt
ok görselini geliştir
User prompt
ok eklendiği zaman ekranın sol köşesinde ortada dursun ve 2 saniyede bir balonu patlatsın
User prompt
dükkana 100 puanlık bir ok ekle
User prompt
Dükkanda auto shooter ın üstüne 100 puan değerinde bir ok koy ve bu ok 2 saniyede bir baloncuk patlatsın
User prompt
shopdan extra time ve speed boost kaldır
User prompt
2 tane silah alındığı zaman 2. sini ise tam simetrik olarak diğer tarafa koy
User prompt
promo code bölümünü kaldır
User prompt
dükkanda sadece auto shooter kalsın
User prompt
promosyon yerinde hata var yazılmıyo düzelt
User prompt
promosyon kodunu yazınca ekranda göster
User prompt
promosyon bölümündeki close yazsını biraz sola al
User prompt
promo bölümünü biraz aşağı al
User prompt
sol üst köşeyede promosyon kodu butonu ekle ve kod olarak axtra yazıldığında 150 puan ver
User prompt
silahın ateş etme efektini büyüt
User prompt
otomatik silahı sağ tarafa tam ortaya koy
User prompt
otomatik silah gösresilin değiştir ve bir silah görseli koy
User prompt
dükkana 150 pts karşılığında otomatik bir silah koy ve silah her saniye 1 baloncuğu patlatsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
shop yazısının arkasındaki maviliği büyüt
User prompt
shop yazısını büyüt
User prompt
zamanı kaldır zaman sonsuz
User prompt
En üst sağ köşeye dükkan butonu koy ve basınca dükkan açılsın
Code edit (1 edits merged)
Please save this source code
User prompt
Bubble Pop Frenzy
Initial prompt
baloncuk patlatma
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Bubble = Container.expand(function (type, speed) {
var self = Container.call(this);
self.type = type || 'standard';
self.speed = speed || 2;
self.points = 1;
self.isActive = true;
var assetId = 'standardBubble';
if (self.type === 'bonus') {
assetId = 'bonusBubble';
self.points = 5;
} else if (self.type === 'bomb') {
assetId = 'bombBubble';
self.points = -10;
} else if (self.type === 'powerup') {
assetId = 'powerupBubble';
self.points = 2;
}
var bubbleGraphics = self.attachAsset(assetId, {
anchorX: 0.5,
anchorY: 0.5
});
if (self.type === 'bonus') {
bubbleGraphics.scale.set(1.2);
} else if (self.type === 'powerup') {
bubbleGraphics.scale.set(0.9);
}
// Add some interactivity by scaling bubble on press
self.down = function (x, y, obj) {
if (!self.isActive) {
return;
}
// Scale down bubble when pressed
tween(bubbleGraphics, {
scaleX: 0.8,
scaleY: 0.8
}, {
duration: 100,
easing: tween.easeOut
});
self.pop();
};
self.pop = function () {
if (!self.isActive) {
return;
}
self.isActive = false;
// Play sound based on bubble type
if (self.type === 'bomb') {
LK.getSound('explosion').play();
} else if (self.type === 'bonus') {
LK.getSound('bonus').play();
} else if (self.type === 'powerup') {
LK.getSound('powerup').play();
} else {
LK.getSound('pop').play();
}
// Animation for popping
tween(bubbleGraphics, {
scaleX: 1.5,
scaleY: 1.5,
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
if (self.parent) {
self.parent.removeChild(self);
}
}
});
// Update score
LK.setScore(LK.getScore() + self.points);
// Handle special effects
if (self.type === 'bomb') {
// Flash screen red for bomb
LK.effects.flashScreen(0xe74c3c, 300);
} else if (self.type === 'powerup') {
// Slow down all bubbles
if (slowDownTimer) {
LK.clearTimeout(slowDownTimer);
}
bubbleSpeed = baseSpeed * 0.5;
slowDownTimer = LK.setTimeout(function () {
bubbleSpeed = baseSpeed;
}, 5000);
}
};
self.update = function () {
if (!self.isActive) {
return;
}
// Move bubble upward
self.y -= self.speed;
// Slight side-to-side movement
self.x += Math.sin(LK.ticks / 20 + self.id * 0.3) * 0.8;
// Remove if bubble goes off-screen
if (self.y < -150) {
// If bomb escapes screen, that's good
if (self.type === 'bomb') {
LK.setScore(LK.getScore() + 2);
}
// If it's a bonus and escapes, that's bad
else if (self.type === 'bonus') {
LK.setScore(LK.getScore() - 2);
}
if (self.parent) {
self.parent.removeChild(self);
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game variables
var bubbles = [];
var level = 1;
var baseSpeed = 2;
var bubbleSpeed = baseSpeed;
var spawnRate = 60; // Ticks between bubble spawns
var maxBubbles = 10;
var timer = 0;
var gameTime = 60; // Game duration in seconds
var timeDisplay;
var scoreDisplay;
var levelDisplay;
var slowDownTimer = null;
var bubbleIdCounter = 0;
// Set up UI
function setupUI() {
// Score display
scoreDisplay = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreDisplay.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreDisplay);
// Time display
timeDisplay = new Text2('Time: ' + gameTime, {
size: 80,
fill: 0xFFFFFF
});
timeDisplay.anchor.set(0, 0);
LK.gui.topRight.addChild(timeDisplay);
// Level display
levelDisplay = new Text2('Level: ' + level, {
size: 80,
fill: 0xFFFFFF
});
levelDisplay.anchor.set(1, 0);
LK.gui.topLeft.addChild(levelDisplay);
// Position them properly
timeDisplay.x = -20;
timeDisplay.y = 20;
levelDisplay.x = -120;
levelDisplay.y = 120; // Keep away from top left corner
scoreDisplay.y = 20;
}
// Spawn a new bubble
function spawnBubble() {
if (bubbles.length >= maxBubbles) {
return;
}
var type = 'standard';
var rand = Math.random();
// Determine bubble type based on probability
if (rand < 0.05) {
type = 'bomb';
} else if (rand < 0.15) {
type = 'bonus';
} else if (rand < 0.20) {
type = 'powerup';
}
// Create bubble
var bubble = new Bubble(type, bubbleSpeed);
bubble.id = bubbleIdCounter++;
// Position at random X at bottom of screen
bubble.x = Math.random() * (2048 - 200) + 100;
bubble.y = 2732 + 100;
// Add bubble to game and array
game.addChild(bubble);
bubbles.push(bubble);
}
// Remove bubble from array
function removeBubble(bubble) {
var index = bubbles.indexOf(bubble);
if (index > -1) {
bubbles.splice(index, 1);
}
}
// Update game difficulty based on level
function updateDifficulty() {
baseSpeed = 2 + level * 0.5;
bubbleSpeed = baseSpeed;
spawnRate = Math.max(20, 60 - level * 5);
maxBubbles = 10 + level;
}
// Update level based on score
function checkLevelUp() {
var newLevel = Math.floor(LK.getScore() / 50) + 1;
if (newLevel > level) {
level = newLevel;
levelDisplay.setText('Level: ' + level);
updateDifficulty();
// Flash screen to indicate level up
LK.effects.flashScreen(0x2ecc71, 500);
}
}
// Initialize game
function initGame() {
LK.setScore(0);
level = 1;
timer = 0;
gameTime = 60;
bubbleSpeed = baseSpeed;
bubbleIdCounter = 0;
// Clear any existing bubbles
for (var i = bubbles.length - 1; i >= 0; i--) {
game.removeChild(bubbles[i]);
}
bubbles = [];
// Set up UI
setupUI();
// Update difficulty
updateDifficulty();
// Start background music
LK.playMusic('bgMusic', {
fade: {
start: 0,
end: 0.4,
duration: 1000
}
});
}
// Update game timer
function updateTimer() {
if (timer % 60 === 0) {
// Every second
gameTime--;
timeDisplay.setText('Time: ' + gameTime);
if (gameTime <= 0) {
endGame();
}
}
}
// End game
function endGame() {
if (LK.getScore() >= 100) {
LK.showYouWin();
} else {
LK.showGameOver();
}
}
// Initialize the game
initGame();
// Main game update function
game.update = function () {
timer++;
// Update timer
updateTimer();
// Update score display
scoreDisplay.setText('Score: ' + LK.getScore());
// Check for level up
checkLevelUp();
// Spawn bubbles at regular intervals
if (timer % spawnRate === 0) {
spawnBubble();
}
// Clean up bubbles that are no longer in the scene
for (var i = bubbles.length - 1; i >= 0; i--) {
if (!bubbles[i].parent) {
removeBubble(bubbles[i]);
}
}
};
// Handle game clicks/taps
game.down = function (x, y, obj) {
// Just handle click/tap on the game background
// Bubbles have their own click handlers
};
// Handle mouse/touch movement
game.move = function (x, y, obj) {
// No implementation needed for this game
}; ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,302 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1");
+
+/****
+* Classes
+****/
+var Bubble = Container.expand(function (type, speed) {
+ var self = Container.call(this);
+ self.type = type || 'standard';
+ self.speed = speed || 2;
+ self.points = 1;
+ self.isActive = true;
+ var assetId = 'standardBubble';
+ if (self.type === 'bonus') {
+ assetId = 'bonusBubble';
+ self.points = 5;
+ } else if (self.type === 'bomb') {
+ assetId = 'bombBubble';
+ self.points = -10;
+ } else if (self.type === 'powerup') {
+ assetId = 'powerupBubble';
+ self.points = 2;
+ }
+ var bubbleGraphics = self.attachAsset(assetId, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ if (self.type === 'bonus') {
+ bubbleGraphics.scale.set(1.2);
+ } else if (self.type === 'powerup') {
+ bubbleGraphics.scale.set(0.9);
+ }
+ // Add some interactivity by scaling bubble on press
+ self.down = function (x, y, obj) {
+ if (!self.isActive) {
+ return;
+ }
+ // Scale down bubble when pressed
+ tween(bubbleGraphics, {
+ scaleX: 0.8,
+ scaleY: 0.8
+ }, {
+ duration: 100,
+ easing: tween.easeOut
+ });
+ self.pop();
+ };
+ self.pop = function () {
+ if (!self.isActive) {
+ return;
+ }
+ self.isActive = false;
+ // Play sound based on bubble type
+ if (self.type === 'bomb') {
+ LK.getSound('explosion').play();
+ } else if (self.type === 'bonus') {
+ LK.getSound('bonus').play();
+ } else if (self.type === 'powerup') {
+ LK.getSound('powerup').play();
+ } else {
+ LK.getSound('pop').play();
+ }
+ // Animation for popping
+ tween(bubbleGraphics, {
+ scaleX: 1.5,
+ scaleY: 1.5,
+ alpha: 0
+ }, {
+ duration: 300,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ if (self.parent) {
+ self.parent.removeChild(self);
+ }
+ }
+ });
+ // Update score
+ LK.setScore(LK.getScore() + self.points);
+ // Handle special effects
+ if (self.type === 'bomb') {
+ // Flash screen red for bomb
+ LK.effects.flashScreen(0xe74c3c, 300);
+ } else if (self.type === 'powerup') {
+ // Slow down all bubbles
+ if (slowDownTimer) {
+ LK.clearTimeout(slowDownTimer);
+ }
+ bubbleSpeed = baseSpeed * 0.5;
+ slowDownTimer = LK.setTimeout(function () {
+ bubbleSpeed = baseSpeed;
+ }, 5000);
+ }
+ };
+ self.update = function () {
+ if (!self.isActive) {
+ return;
+ }
+ // Move bubble upward
+ self.y -= self.speed;
+ // Slight side-to-side movement
+ self.x += Math.sin(LK.ticks / 20 + self.id * 0.3) * 0.8;
+ // Remove if bubble goes off-screen
+ if (self.y < -150) {
+ // If bomb escapes screen, that's good
+ if (self.type === 'bomb') {
+ LK.setScore(LK.getScore() + 2);
+ }
+ // If it's a bonus and escapes, that's bad
+ else if (self.type === 'bonus') {
+ LK.setScore(LK.getScore() - 2);
+ }
+ if (self.parent) {
+ self.parent.removeChild(self);
+ }
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var bubbles = [];
+var level = 1;
+var baseSpeed = 2;
+var bubbleSpeed = baseSpeed;
+var spawnRate = 60; // Ticks between bubble spawns
+var maxBubbles = 10;
+var timer = 0;
+var gameTime = 60; // Game duration in seconds
+var timeDisplay;
+var scoreDisplay;
+var levelDisplay;
+var slowDownTimer = null;
+var bubbleIdCounter = 0;
+// Set up UI
+function setupUI() {
+ // Score display
+ scoreDisplay = new Text2('Score: 0', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ scoreDisplay.anchor.set(0.5, 0);
+ LK.gui.top.addChild(scoreDisplay);
+ // Time display
+ timeDisplay = new Text2('Time: ' + gameTime, {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ timeDisplay.anchor.set(0, 0);
+ LK.gui.topRight.addChild(timeDisplay);
+ // Level display
+ levelDisplay = new Text2('Level: ' + level, {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ levelDisplay.anchor.set(1, 0);
+ LK.gui.topLeft.addChild(levelDisplay);
+ // Position them properly
+ timeDisplay.x = -20;
+ timeDisplay.y = 20;
+ levelDisplay.x = -120;
+ levelDisplay.y = 120; // Keep away from top left corner
+ scoreDisplay.y = 20;
+}
+// Spawn a new bubble
+function spawnBubble() {
+ if (bubbles.length >= maxBubbles) {
+ return;
+ }
+ var type = 'standard';
+ var rand = Math.random();
+ // Determine bubble type based on probability
+ if (rand < 0.05) {
+ type = 'bomb';
+ } else if (rand < 0.15) {
+ type = 'bonus';
+ } else if (rand < 0.20) {
+ type = 'powerup';
+ }
+ // Create bubble
+ var bubble = new Bubble(type, bubbleSpeed);
+ bubble.id = bubbleIdCounter++;
+ // Position at random X at bottom of screen
+ bubble.x = Math.random() * (2048 - 200) + 100;
+ bubble.y = 2732 + 100;
+ // Add bubble to game and array
+ game.addChild(bubble);
+ bubbles.push(bubble);
+}
+// Remove bubble from array
+function removeBubble(bubble) {
+ var index = bubbles.indexOf(bubble);
+ if (index > -1) {
+ bubbles.splice(index, 1);
+ }
+}
+// Update game difficulty based on level
+function updateDifficulty() {
+ baseSpeed = 2 + level * 0.5;
+ bubbleSpeed = baseSpeed;
+ spawnRate = Math.max(20, 60 - level * 5);
+ maxBubbles = 10 + level;
+}
+// Update level based on score
+function checkLevelUp() {
+ var newLevel = Math.floor(LK.getScore() / 50) + 1;
+ if (newLevel > level) {
+ level = newLevel;
+ levelDisplay.setText('Level: ' + level);
+ updateDifficulty();
+ // Flash screen to indicate level up
+ LK.effects.flashScreen(0x2ecc71, 500);
+ }
+}
+// Initialize game
+function initGame() {
+ LK.setScore(0);
+ level = 1;
+ timer = 0;
+ gameTime = 60;
+ bubbleSpeed = baseSpeed;
+ bubbleIdCounter = 0;
+ // Clear any existing bubbles
+ for (var i = bubbles.length - 1; i >= 0; i--) {
+ game.removeChild(bubbles[i]);
+ }
+ bubbles = [];
+ // Set up UI
+ setupUI();
+ // Update difficulty
+ updateDifficulty();
+ // Start background music
+ LK.playMusic('bgMusic', {
+ fade: {
+ start: 0,
+ end: 0.4,
+ duration: 1000
+ }
+ });
+}
+// Update game timer
+function updateTimer() {
+ if (timer % 60 === 0) {
+ // Every second
+ gameTime--;
+ timeDisplay.setText('Time: ' + gameTime);
+ if (gameTime <= 0) {
+ endGame();
+ }
+ }
+}
+// End game
+function endGame() {
+ if (LK.getScore() >= 100) {
+ LK.showYouWin();
+ } else {
+ LK.showGameOver();
+ }
+}
+// Initialize the game
+initGame();
+// Main game update function
+game.update = function () {
+ timer++;
+ // Update timer
+ updateTimer();
+ // Update score display
+ scoreDisplay.setText('Score: ' + LK.getScore());
+ // Check for level up
+ checkLevelUp();
+ // Spawn bubbles at regular intervals
+ if (timer % spawnRate === 0) {
+ spawnBubble();
+ }
+ // Clean up bubbles that are no longer in the scene
+ for (var i = bubbles.length - 1; i >= 0; i--) {
+ if (!bubbles[i].parent) {
+ removeBubble(bubbles[i]);
+ }
+ }
+};
+// Handle game clicks/taps
+game.down = function (x, y, obj) {
+ // Just handle click/tap on the game background
+ // Bubbles have their own click handlers
+};
+// Handle mouse/touch movement
+game.move = function (x, y, obj) {
+ // No implementation needed for this game
+};
\ No newline at end of file