User prompt
Oyun başlama ekranında ki renk yakalama oyunu textini Renkli topları yakala ile değiştir yazısını
User prompt
Nasıl oynanır kısmını daha özenli yapabilir misin
User prompt
Ayarlar kısmında müzik: açık kısmında ki texti Oyun başlayınca arka plan müziği:açık Oyun başlayınca arka plan müziği:kapalı olarak değiştir textini.
User prompt
**Oyun Ayarları** - **Zorluk Seviyesi**: Kolay/Orta/Zor mod seçimi - **Oyun Hızı**: Başlangıç hızı ayarı - **Renk Modu**: Normal renkler / Renk körü dostu renkler - **Şekil Boyutu**: Küçük/Normal/Büyük şekiller ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyunu başlatma ekranındayken background müziği çalmasın. Oyunu başlat dedikten sonra çalsın.
User prompt
Oyunu başlatma ekranında background müziğini çalma
User prompt
Senden şunu istiyorum. Ana menüde ki oyun yapimcisina tikladigimda arka plan müziğini durdur yerine ekledigim Created yazan sesi oraya ekle ve o çalsın ama sadece o menüye girdiğimde çalsın ciktigimda müziği kapat background müziği devam etsin
User prompt
Ellipse yapalım istersen
User prompt
Add the basketball sound when I basket the ball correctly
User prompt
Tavsiyenizi isterim ama beğenmezsen geri al dediğimde geri alır mısın yaptıklarını
User prompt
Renk yakalama oyunu textinin renklerini sadece sarı turuncu pembe mavi olarak ayarla hareketli ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Renk yakalama oyunu yazisinin textini renkli yapabilir misin hareketli ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Starting ekranında ki butonlara bastığımda tıkladığımda click sesi çalsın
User prompt
Renk yakalama oyunu yazisinin textini yan yana yazar mısın düzelt
User prompt
Peki starting ekranında üstte yazan yapımcı Şafak textini siler misin
User prompt
Ayarların içinde değil ayrı bir buton olarak ekle demek istedim
User prompt
Renk yakalama oyunu yapımcı Şafak yazısını ayarlar kısmının altına bir buton daha yerleştir ve yapımcılar yaz oraya tıklandiginda yapımcı ismi gözüksün
User prompt
COLOR MATCH CASCADE text yazısını değiş ve oyunu yapan kişinin ismini yaz yani ben Şafak
User prompt
Oyunu kaydet ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Müziği açma kapatma ekle ayarlar kısmında aktif olsun.
User prompt
Oyuna giriş ekranı ekle oyunu başlat, ayarlar,nasıl oynanir, çıkış ekranı olsun
User prompt
Add background music
Code edit (1 edits merged)
Please save this source code
User prompt
Color Match Cascade
Initial prompt
Write me an example of what 2D games you can make here.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
musicEnabled: true,
difficultyLevel: "Normal",
gameSpeedSetting: "Normal",
colorMode: "Normal",
shapeSize: "Normal"
});
/****
* Classes
****/
var BackgroundParticle = Container.expand(function () {
var self = Container.call(this);
var colors = [0xfeca57, 0xff9500, 0xff69b4, 0x4da6ff, 0xffffff]; // Yellow, Orange, Pink, Blue, White
var randomColor = colors[Math.floor(Math.random() * colors.length)];
var particleGraphics = self.attachAsset('particle', {
anchorX: 0.5,
anchorY: 0.5
});
particleGraphics.tint = randomColor;
particleGraphics.alpha = 0.3 + Math.random() * 0.4; // Random transparency
self.speedX = (Math.random() - 0.5) * 0.5;
self.speedY = -0.3 - Math.random() * 0.7;
self.life = 0;
self.maxLife = 300 + Math.random() * 200;
var initialScale = 0.3 + Math.random() * 0.7;
particleGraphics.scaleX = initialScale;
particleGraphics.scaleY = initialScale;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
self.life++;
// Fade out as particle ages
var lifeRatio = self.life / self.maxLife;
particleGraphics.alpha = (1 - lifeRatio) * (0.3 + Math.random() * 0.4);
// Gentle floating motion
self.x += Math.sin(self.life * 0.01) * 0.1;
// Remove particle when it's old or off screen
if (self.life >= self.maxLife || self.y < -50 || self.x < -50 || self.x > 2100) {
self.shouldRemove = true;
}
};
return self;
});
var Basket = Container.expand(function (color) {
var self = Container.call(this);
self.color = color;
var basketGraphics = self.attachAsset(color + 'Basket', {
anchorX: 0.5,
anchorY: 0.5
});
// Apply shape size setting to baskets
var sizeMultiplier = shapeSize === 'Small' ? 0.7 : shapeSize === 'Large' ? 1.3 : 1.0;
basketGraphics.scaleX = sizeMultiplier;
basketGraphics.scaleY = sizeMultiplier;
return self;
});
var FallingShape = Container.expand(function (color) {
var self = Container.call(this);
self.color = color;
self.speed = 3;
self.lastY = 0;
var shapeGraphics = self.attachAsset(color + 'Shape', {
anchorX: 0.5,
anchorY: 0.5
});
// Apply shape size setting
var sizeMultiplier = shapeSize === 'Small' ? 0.7 : shapeSize === 'Large' ? 1.3 : 1.0;
shapeGraphics.scaleX = sizeMultiplier;
shapeGraphics.scaleY = sizeMultiplier;
self.update = function () {
self.lastY = self.y;
self.y += self.speed;
};
return self;
});
var MenuButton = Container.expand(function (text, color) {
var self = Container.call(this);
// Create button background
self.bg = LK.getAsset('shape', {
width: 600,
height: 120,
color: color || 0x3498db,
shape: 'ellipse',
anchorX: 0.5,
anchorY: 0.5
});
self.addChild(self.bg);
// Create button text
self.text = new Text2(text, {
size: 60,
fill: 0xFFFFFF
});
self.text.anchor.set(0.5, 0.5);
self.addChild(self.text);
self.isPressed = false;
self.down = function (x, y, obj) {
self.isPressed = true;
tween(self, {
scaleX: 0.95,
scaleY: 0.95
}, {
duration: 100
});
};
self.up = function (x, y, obj) {
if (self.isPressed) {
self.isPressed = false;
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 100
});
if (self.onClick) {
self.onClick();
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c3e50
});
/****
* Game Code
****/
var baskets = [];
var fallingShapes = [];
// Update colors based on color mode
var colors = colorMode === 'ColorBlind' ? ['red', 'blue', 'yellow'] : ['red', 'blue', 'yellow'];
// Note: In real implementation, colorblind mode would use different color combinations
var gameSpeed = 1;
var consecutiveMatches = 0;
var draggedBasket = null;
var gameState = 'menu'; // 'menu', 'playing', 'howtoplay', 'settings'
var menuButtons = [];
var currentMenu = null;
var musicEnabled = storage.musicEnabled !== undefined ? storage.musicEnabled : true; // Track music state
var highScore = storage.highScore || 0; // Load saved high score
// Game settings from storage
var difficultyLevel = storage.difficultyLevel || 'Normal'; // Easy, Normal, Hard
var gameSpeedSetting = storage.gameSpeedSetting || 'Normal'; // Slow, Normal, Fast
var colorMode = storage.colorMode || 'Normal'; // Normal, ColorBlind
var shapeSize = storage.shapeSize || 'Normal'; // Small, Normal, Large
// Create animated background
var backgroundContainer = new Container();
game.addChild(backgroundContainer);
// Create gradient layers
var gradientLayer1 = LK.getAsset('gradientLayer1', {
anchorX: 0,
anchorY: 0
});
gradientLayer1.x = 0;
gradientLayer1.y = 0;
gradientLayer1.alpha = 0.8;
backgroundContainer.addChild(gradientLayer1);
var gradientLayer2 = LK.getAsset('gradientLayer2', {
anchorX: 0,
anchorY: 0
});
gradientLayer2.x = 0;
gradientLayer2.y = 0;
gradientLayer2.alpha = 0.6;
backgroundContainer.addChild(gradientLayer2);
// Animate gradient layers
function animateGradientLayers() {
tween(gradientLayer1, {
alpha: 0.4
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(gradientLayer1, {
alpha: 0.8
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: animateGradientLayers
});
}
});
tween(gradientLayer2, {
alpha: 0.3
}, {
duration: 2500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(gradientLayer2, {
alpha: 0.6
}, {
duration: 2500,
easing: tween.easeInOut
});
}
});
}
animateGradientLayers();
// Particle system
var backgroundParticles = [];
var particleSpawnTimer = 0;
// Create score display (initially hidden)
var scoreTxt = new Text2('0', {
size: 100,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
scoreTxt.visible = false;
LK.gui.top.addChild(scoreTxt);
// Initialize menu system
function createMainMenu() {
gameState = 'menu';
// Clear existing menu
if (currentMenu) {
currentMenu.destroy();
}
currentMenu = new Container();
game.addChild(currentMenu);
// Game title
var titleText = new Text2('Renkli topları yakala', {
size: 100,
fill: 0xff6b6b
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 600;
currentMenu.addChild(titleText);
// Animate title with color cycling and movement
var titleColors = [0xfeca57, 0xff9500, 0xff69b4, 0x4da6ff]; // Yellow, Orange, Pink, Blue
var currentColorIndex = 0;
function animateTitle() {
// Color cycling animation
currentColorIndex = (currentColorIndex + 1) % titleColors.length;
tween(titleText, {
tint: titleColors[currentColorIndex]
}, {
duration: 1500,
easing: tween.easeInOut,
onFinish: function onFinish() {
animateTitle();
}
});
// Gentle floating movement
var targetY = 600 + Math.sin(Date.now() * 0.001) * 20;
tween(titleText, {
y: targetY,
scaleX: 1.05,
scaleY: 1.05
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(titleText, {
scaleX: 1,
scaleY: 1
}, {
duration: 2000,
easing: tween.easeInOut
});
}
});
}
// Start the animation
animateTitle();
// High score display
var highScoreText = new Text2('En Yüksek Skor: ' + highScore, {
size: 60,
fill: 0xf1c40f
});
highScoreText.anchor.set(0.5, 0.5);
highScoreText.x = 2048 / 2;
highScoreText.y = 800;
currentMenu.addChild(highScoreText);
// Menu buttons
var startButton = new MenuButton('OYUNU BAŞLAT', 0x27ae60);
startButton.x = 2048 / 2;
startButton.y = 1000;
startButton.onClick = function () {
LK.getSound('Click').play();
startGame();
};
currentMenu.addChild(startButton);
var howToPlayButton = new MenuButton('NASIL OYNANIR', 0x3498db);
howToPlayButton.x = 2048 / 2;
howToPlayButton.y = 1200;
howToPlayButton.onClick = function () {
LK.getSound('Click').play();
showHowToPlay();
};
currentMenu.addChild(howToPlayButton);
var settingsButton = new MenuButton('AYARLAR', 0xf39c12);
settingsButton.x = 2048 / 2;
settingsButton.y = 1400;
settingsButton.onClick = function () {
LK.getSound('Click').play();
showSettings();
};
currentMenu.addChild(settingsButton);
var creatorsButton = new MenuButton('YAPIMCILAR', 0x9b59b6);
creatorsButton.x = 2048 / 2;
creatorsButton.y = 1600;
creatorsButton.onClick = function () {
LK.getSound('Click').play();
showCreators();
};
currentMenu.addChild(creatorsButton);
var exitButton = new MenuButton('ÇIKIŞ', 0xe74c3c);
exitButton.x = 2048 / 2;
exitButton.y = 1800;
exitButton.onClick = function () {
LK.getSound('Click').play();
// On mobile, we can't actually exit, so show a message
LK.effects.flashScreen(0x000000, 1000);
};
currentMenu.addChild(exitButton);
}
function startGame() {
gameState = 'playing';
// Clear menu
if (currentMenu) {
currentMenu.destroy();
currentMenu = null;
}
// Show score
scoreTxt.visible = true;
// Create baskets
for (var i = 0; i < 3; i++) {
var basket = new Basket(colors[i]);
basket.x = 2048 / 4 * (i + 1);
basket.y = 2732 - 200;
baskets.push(basket);
game.addChild(basket);
}
// Start background music only if enabled
if (musicEnabled) {
LK.playMusic('Background');
}
// Reset game variables and apply settings
// Apply difficulty level
var baseSpeed = difficultyLevel === 'Easy' ? 0.5 : difficultyLevel === 'Hard' ? 1.5 : 1.0;
// Apply game speed setting
var speedMultiplier = gameSpeedSetting === 'Slow' ? 0.7 : gameSpeedSetting === 'Fast' ? 1.3 : 1.0;
gameSpeed = baseSpeed * speedMultiplier;
consecutiveMatches = 0;
LK.setScore(0);
scoreTxt.setText('0');
}
function showHowToPlay() {
gameState = 'howtoplay';
// Clear existing menu
if (currentMenu) {
currentMenu.destroy();
}
currentMenu = new Container();
game.addChild(currentMenu);
// Title
var titleText = new Text2('NASIL OYNANIR', {
size: 80,
fill: 0xff6b6b
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 400;
currentMenu.addChild(titleText);
// Game objective section
var objectiveText = new Text2('🎯 OYUNUN AMACI', {
size: 60,
fill: 0xf1c40f
});
objectiveText.anchor.set(0.5, 0.5);
objectiveText.x = 2048 / 2;
objectiveText.y = 600;
currentMenu.addChild(objectiveText);
var objectiveDesc = new Text2('Yukarıdan düşen renkli şekilleri\naynı renkteki sepetlerle yakalayın!', {
size: 45,
fill: 0xFFFFFF
});
objectiveDesc.anchor.set(0.5, 0.5);
objectiveDesc.x = 2048 / 2;
objectiveDesc.y = 720;
currentMenu.addChild(objectiveDesc);
// Controls section
var controlsText = new Text2('🎮 KONTROLLER', {
size: 60,
fill: 0x3498db
});
controlsText.anchor.set(0.5, 0.5);
controlsText.x = 2048 / 2;
controlsText.y = 900;
currentMenu.addChild(controlsText);
var controlsDesc = new Text2('• Sepetleri parmağınızla sürükleyerek hareket ettirin\n• Sepetler yatay olarak sola-sağa hareket eder\n• Dokunup sürükleyerek sepeti istediğiniz yere getirin', {
size: 40,
fill: 0xFFFFFF
});
controlsDesc.anchor.set(0.5, 0.5);
controlsDesc.x = 2048 / 2;
controlsDesc.y = 1060;
currentMenu.addChild(controlsDesc);
// Scoring section
var scoringText = new Text2('🏆 PUANLAMA', {
size: 60,
fill: 0x27ae60
});
scoringText.anchor.set(0.5, 0.5);
scoringText.x = 2048 / 2;
scoringText.y = 1280;
currentMenu.addChild(scoringText);
var scoringDesc = new Text2('• Doğru renk yakaladığınızda: +10 puan\n• Ardışık başarılı yakalamalar bonus puan verir\n• Her başarılı yakalama sonraki puanı artırır', {
size: 40,
fill: 0xFFFFFF
});
scoringDesc.anchor.set(0.5, 0.5);
scoringDesc.x = 2048 / 2;
scoringDesc.y = 1400;
currentMenu.addChild(scoringDesc);
// Game over conditions
var gameOverText = new Text2('❌ OYUN BİTİŞ KOŞULLARI', {
size: 60,
fill: 0xe74c3c
});
gameOverText.anchor.set(0.5, 0.5);
gameOverText.x = 2048 / 2;
gameOverText.y = 1580;
currentMenu.addChild(gameOverText);
var gameOverDesc = new Text2('• Yanlış renkteki sepete şekil düşürürseniz\n• Herhangi bir şekli kaçırırsanız (yere düşerse)\n• Dikkat edin: Oyun hızlanarak zorlaşır!', {
size: 40,
fill: 0xFFFFFF
});
gameOverDesc.anchor.set(0.5, 0.5);
gameOverDesc.x = 2048 / 2;
gameOverDesc.y = 1700;
currentMenu.addChild(gameOverDesc);
// Tips section
var tipsText = new Text2('💡 İPUÇLARI', {
size: 60,
fill: 0x9b59b6
});
tipsText.anchor.set(0.5, 0.5);
tipsText.x = 2048 / 2;
tipsText.y = 1880;
currentMenu.addChild(tipsText);
var tipsDesc = new Text2('• Sepetleri önceden konumlandırın\n• Oyun ilerledikçe hızlanacağını unutmayın\n• Ayarlardan zorluk seviyesini değiştirebilirsiniz', {
size: 40,
fill: 0xFFFFFF
});
tipsDesc.anchor.set(0.5, 0.5);
tipsDesc.x = 2048 / 2;
tipsDesc.y = 2000;
currentMenu.addChild(tipsDesc);
// Back button
var backButton = new MenuButton('GERİ', 0x95a5a6);
backButton.x = 2048 / 2;
backButton.y = 2300;
backButton.onClick = function () {
LK.getSound('Click').play();
createMainMenu();
};
currentMenu.addChild(backButton);
}
function showSettings() {
gameState = 'settings';
// Clear existing menu
if (currentMenu) {
currentMenu.destroy();
}
currentMenu = new Container();
game.addChild(currentMenu);
// Settings title
var settingsText = new Text2('AYARLAR', {
size: 80,
fill: 0xFFFFFF
});
settingsText.anchor.set(0.5, 0.5);
settingsText.x = 2048 / 2;
settingsText.y = 500;
currentMenu.addChild(settingsText);
// Music toggle button
var musicButton = new MenuButton(musicEnabled ? 'Oyun başlayınca arka plan müziği: açık' : 'Oyun başlayınca arka plan müziği: kapalı', musicEnabled ? 0x27ae60 : 0xe74c3c);
musicButton.x = 2048 / 2;
musicButton.y = 700;
musicButton.onClick = function () {
LK.getSound('Click').play();
musicEnabled = !musicEnabled;
storage.musicEnabled = musicEnabled; // Save music preference
if (musicEnabled) {
LK.playMusic('Background');
musicButton.text.setText('Oyun başlayınca arka plan müziği: açık');
musicButton.bg.tint = 0x27ae60;
} else {
LK.stopMusic();
musicButton.text.setText('Oyun başlayınca arka plan müziği: kapalı');
musicButton.bg.tint = 0xe74c3c;
}
};
currentMenu.addChild(musicButton);
// Difficulty Level button
var difficultyButton = new MenuButton('Zorluk: ' + difficultyLevel, 0x8e44ad);
difficultyButton.x = 2048 / 2;
difficultyButton.y = 900;
difficultyButton.onClick = function () {
LK.getSound('Click').play();
var levels = ['Easy', 'Normal', 'Hard'];
var currentIndex = levels.indexOf(difficultyLevel);
difficultyLevel = levels[(currentIndex + 1) % levels.length];
storage.difficultyLevel = difficultyLevel;
difficultyButton.text.setText('Zorluk: ' + difficultyLevel);
var colors = [0x27ae60, 0xf39c12, 0xe74c3c];
difficultyButton.bg.tint = colors[levels.indexOf(difficultyLevel)];
};
currentMenu.addChild(difficultyButton);
// Game Speed button
var speedButton = new MenuButton('Hız: ' + gameSpeedSetting, 0x3498db);
speedButton.x = 2048 / 2;
speedButton.y = 1100;
speedButton.onClick = function () {
LK.getSound('Click').play();
var speeds = ['Slow', 'Normal', 'Fast'];
var currentIndex = speeds.indexOf(gameSpeedSetting);
gameSpeedSetting = speeds[(currentIndex + 1) % speeds.length];
storage.gameSpeedSetting = gameSpeedSetting;
speedButton.text.setText('Hız: ' + gameSpeedSetting);
var colors = [0x95a5a6, 0x3498db, 0xe67e22];
speedButton.bg.tint = colors[speeds.indexOf(gameSpeedSetting)];
};
currentMenu.addChild(speedButton);
// Color Mode button
var colorButton = new MenuButton('Renk: ' + colorMode, 0x16a085);
colorButton.x = 2048 / 2;
colorButton.y = 1300;
colorButton.onClick = function () {
LK.getSound('Click').play();
var modes = ['Normal', 'ColorBlind'];
var currentIndex = modes.indexOf(colorMode);
colorMode = modes[(currentIndex + 1) % modes.length];
storage.colorMode = colorMode;
colorButton.text.setText('Renk: ' + colorMode);
colorButton.bg.tint = colorMode === 'Normal' ? 0x16a085 : 0x34495e;
};
currentMenu.addChild(colorButton);
// Shape Size button
var sizeButton = new MenuButton('Boyut: ' + shapeSize, 0xd35400);
sizeButton.x = 2048 / 2;
sizeButton.y = 1500;
sizeButton.onClick = function () {
LK.getSound('Click').play();
var sizes = ['Small', 'Normal', 'Large'];
var currentIndex = sizes.indexOf(shapeSize);
shapeSize = sizes[(currentIndex + 1) % sizes.length];
storage.shapeSize = shapeSize;
sizeButton.text.setText('Boyut: ' + shapeSize);
var colors = [0x95a5a6, 0xd35400, 0x8e44ad];
sizeButton.bg.tint = colors[sizes.indexOf(shapeSize)];
};
currentMenu.addChild(sizeButton);
// Back button
var backButton = new MenuButton('GERİ', 0x95a5a6);
backButton.x = 2048 / 2;
backButton.y = 1800;
backButton.onClick = function () {
LK.getSound('Click').play();
createMainMenu();
};
currentMenu.addChild(backButton);
}
function showCreators() {
gameState = 'creators';
// Stop background music and play Creators music
LK.stopMusic();
LK.playMusic('Creators');
// Clear existing menu
if (currentMenu) {
currentMenu.destroy();
}
currentMenu = new Container();
game.addChild(currentMenu);
// Creators title
var creatorsTitle = new Text2('YAPIMCILAR', {
size: 80,
fill: 0xFFFFFF
});
creatorsTitle.anchor.set(0.5, 0.5);
creatorsTitle.x = 2048 / 2;
creatorsTitle.y = 800;
currentMenu.addChild(creatorsTitle);
// Creator name
var creatorText = new Text2('Oyun Geliştiricisi:\n\nŞafak', {
size: 70,
fill: 0xf1c40f
});
creatorText.anchor.set(0.5, 0.5);
creatorText.x = 2048 / 2;
creatorText.y = 1200;
currentMenu.addChild(creatorText);
// Back button
var backButton = new MenuButton('GERİ', 0x95a5a6);
backButton.x = 2048 / 2;
backButton.y = 2200;
backButton.onClick = function () {
LK.getSound('Click').play();
// Stop Creators music and restore background music if enabled
LK.stopMusic();
if (musicEnabled) {
LK.playMusic('Background');
}
createMainMenu();
};
currentMenu.addChild(backButton);
}
// Initialize main menu
createMainMenu();
// Spawn falling shapes
function spawnShape() {
var randomColor = colors[Math.floor(Math.random() * colors.length)];
var shape = new FallingShape(randomColor);
shape.x = Math.random() * (2048 - 160) + 80;
shape.y = -80;
// Apply difficulty and speed settings to shape speed
var baseFallSpeed = difficultyLevel === 'Easy' ? 2 : difficultyLevel === 'Hard' ? 4 : 3;
var speedMultiplier = gameSpeedSetting === 'Slow' ? 0.7 : gameSpeedSetting === 'Fast' ? 1.3 : 1.0;
shape.speed = baseFallSpeed * speedMultiplier + gameSpeed * 0.5;
fallingShapes.push(shape);
game.addChild(shape);
}
// Handle touch/mouse events
function handleMove(x, y, obj) {
if (gameState === 'playing' && draggedBasket) {
draggedBasket.x = Math.max(100, Math.min(1948, x));
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
// Only handle basket dragging during gameplay
if (gameState !== 'playing') {
return;
}
// Check if touch is on any basket
for (var i = 0; i < baskets.length; i++) {
var basket = baskets[i];
var dx = x - basket.x;
var dy = y - basket.y;
if (Math.abs(dx) < 100 && Math.abs(dy) < 60) {
draggedBasket = basket;
break;
}
}
};
game.up = function (x, y, obj) {
draggedBasket = null;
};
// Main game loop
var shapeSpawnTimer = 0;
var difficultyTimer = 0;
game.update = function () {
// Update background particles (always running)
particleSpawnTimer++;
if (particleSpawnTimer >= 20) {
// Spawn particle every 20 frames
var particle = new BackgroundParticle();
particle.x = Math.random() * 2048;
particle.y = 2732 + 50; // Start below screen
backgroundParticles.push(particle);
backgroundContainer.addChild(particle);
particleSpawnTimer = 0;
}
// Update and clean up particles
for (var p = backgroundParticles.length - 1; p >= 0; p--) {
var particle = backgroundParticles[p];
if (particle.shouldRemove) {
particle.destroy();
backgroundParticles.splice(p, 1);
}
}
// Only run game logic when actually playing
if (gameState !== 'playing') {
return;
}
// Spawn shapes
shapeSpawnTimer++;
// Calculate spawn interval based on difficulty
var baseInterval = difficultyLevel === 'Easy' ? 150 : difficultyLevel === 'Hard' ? 90 : 120;
var spawnInterval = Math.max(30, baseInterval - gameSpeed * 10);
if (shapeSpawnTimer >= spawnInterval) {
spawnShape();
shapeSpawnTimer = 0;
}
// Update difficulty
difficultyTimer++;
if (difficultyTimer >= 600) {
// Every 10 seconds
gameSpeed += 0.2;
difficultyTimer = 0;
}
// Update falling shapes
for (var i = fallingShapes.length - 1; i >= 0; i--) {
var shape = fallingShapes[i];
// Check if shape went off screen
if (shape.lastY < 2732 && shape.y >= 2732) {
// Shape missed - game over
// Save high score if current score is higher
if (LK.getScore() > highScore) {
highScore = LK.getScore();
storage.highScore = highScore;
}
LK.getSound('miss').play();
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
return;
}
// Check collision with baskets
var caught = false;
for (var j = 0; j < baskets.length; j++) {
var basket = baskets[j];
if (shape.intersects(basket)) {
if (shape.color === basket.color) {
// Correct match
consecutiveMatches++;
var points = 10 + consecutiveMatches * 2;
LK.setScore(LK.getScore() + points);
scoreTxt.setText(LK.getScore());
LK.getSound('catch').play();
LK.getSound('basketball').play();
// Visual feedback
tween(basket, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 200,
onFinish: function onFinish() {
tween(basket, {
scaleX: 1,
scaleY: 1
}, {
duration: 200
});
}
});
} else {
// Wrong color - game over
consecutiveMatches = 0;
// Save high score if current score is higher
if (LK.getScore() > highScore) {
highScore = LK.getScore();
storage.highScore = highScore;
}
LK.getSound('miss').play();
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
return;
}
shape.destroy();
fallingShapes.splice(i, 1);
caught = true;
break;
}
}
// Remove shapes that went too far down without being caught
if (!caught && shape.y > 2800) {
shape.destroy();
fallingShapes.splice(i, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -225,9 +225,9 @@
}
currentMenu = new Container();
game.addChild(currentMenu);
// Game title
- var titleText = new Text2('RENK YAKALAMA OYUNU', {
+ var titleText = new Text2('Renkli topları yakala', {
size: 100,
fill: 0xff6b6b
});
titleText.anchor.set(0.5, 0.5);
Make me a 2d basketball hoop net in yellow color. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap sarı renkli olsun. In-Game asset. 2d. High contrast. No shadows
Make me a 2d basketball hoop net in blue color. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap mavi renk olsun. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap kırmızı renk olsun. In-Game asset. 2d. High contrast. No shadows
Make me a 2d basketball hoop net in red color. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
600x120 size box, Oyunu başlat text yazısı. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topuyap gökkuşağı renklerinde olsun. In-Game asset. 2d. High contrast. No shadows