User prompt
Design a "Daily Gift" popup panel that appears once per day. The background should feature a glowing treasure chest with sparkles and confetti floating around. Include a large button that says "Claim 5 Gems" with a soft glowing effect. The entire layout should feel exciting, magical, and rewarding. Add a subtle countdown timer showing when the next gift will be available (e.g., "Come back in 23h 59m"). Make it visually appealing with animated effects and joyful color tones. ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
my themesdeki temaları biraz küçültte iyi seçebilelim
User prompt
Design the "MY THEMES" selection panel with a dynamic, animated background that slowly shifts colors to give a magical feel. Use elegant cards for each theme, with subtle glowing borders and soft particle effects drifting around. When hovering over a theme, make it slightly enlarge and emit a gentle sparkle. Add small icons or illustrations to represent each theme vividly. Overall, make it look enchanting and premium, like a fantasy gallery. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
envanterdeki golden bird ve fire birdi biraz alta çek
User prompt
Design the inventory panel to look elegant and organized, with a slightly transparent frosted glass effect, soft glowing edges, and subtle shadow for depth. Add small highlight animations when hovering over items. Use classy icons and delicate golden or silver accents to give it a premium, treasure-like feeling. Make sure each slot stands out slightly, like it's on a pedestal, to make players feel proud of their collection. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the shop panel background extremely vibrant and eye-catching, with dynamic gradients, shining particles, soft glowing lights, and subtle animated patterns. Use a premium, luxury theme that makes players excited to buy. Avoid plain colors, add depth and small moving effects like sparkles or flowing lines to make it feel alive and high-value. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Morningde marstaki bulutlar olmasın sadece beyaz bulutlar olsun
User prompt
When the player buys mars, it should be added to their "My Themes" inventory. If they select it from "My Themes", change the game background to a high-quality Mars landscape with reddish tones, craters, and scattered red rocks. Include soft moving dust clouds and a few small sparkling stars in the background to give a magical Mars feeling. The Mars theme should look visually attractive and premium. By default, players start with the "Morning" theme already unlocked in "My Themes". ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
envanterdeki kuşları yan yana 2-2 ayır
User prompt
mağazadaki BIRDS kategorisine bir kuş daha ekle ismi ateş kuş 400 elmas ikonda ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
mağazadaki marsa ikon koy
User prompt
mağazada Morning theme,night theme ve Mars theme arasında boşluk bırak
User prompt
Marketteki Themes kategorisine Mars eklermisin 1500 elmas olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
birşey seçtiğindede ses çıksın
User prompt
mağazada birşey satın alındığında bir ses çıksın
User prompt
Daily giftin arayünün altında Creator:ironx_creator0 yazsın
User prompt
Night Themede bulut olmasın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
My themesteki morning theme ile Night theme yan yana olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
morning themes bedava olsun ve oyuna baslayan otomatikmen my themeste morning olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Themese morning eklermisin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Sol alttaki marketin yanına MY THEMESLER diye yeni bir arayüz ekle. MY THEMESLERDE iki tane şey olacak. Themeslerden biri Night. Oyuncu mağazadan Night temasını satın alıp envantere ekledikten sonra, envanterden Night temasını seçince oyun sahnesinde: ✅ Arka plan (background) gece olsun. ✅ Gökyüzü koyu lacivert veya siyaha dönsün. ✅ Ay ve yıldız gibi küçük detaylar eklenebilir. Bunu yaparken: Night teması seçili olunca sürekli olarak oyunun arka planını gece modunda tut. Diğer temalara geçince eski haline dönsün (örneğin gündüz mavi gökyüzü). Diğeri 2.si "Morning" (sabah) teması eklensin. ✅ Oyuncu oyun içinde hiçbir şey satın almasa bile varsayılan olarak Morning temasına sahip olsun. ✅ Oyun başladığında otomatik olarak arka plan Morning (sabah) temasıyla başlasın. Bu şekilde oyuncular mağazadan başka temalar almadıkça hep Morning temasına sahip olacak ve onu kullanabilecek. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
MY THEMES'e yeni bir şey ekle ismi morning olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyunumun mağaza kısmında bir "THEMES" kategorisi var. Her oyuncunun oyuna ilk başladığında, yani ilk defa oyun açıldığında: ✅ MY THEMES (oyuncunun sahip olduğu temalar) listesine otomatik olarak "Morning" (sabah) teması eklensin. ✅ Oyuncu oyun içinde hiçbir şey satın almasa bile varsayılan olarak Morning temasına sahip olsun. ✅ Oyun başladığında otomatik olarak arka plan Morning (sabah) temasıyla başlasın. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyunumun mağazanın yanında "MY THEMES" kategorisi var. Her oyuncunun oyuna ilk başladığında, yani ilk defa oyun açıldığında: ✅ MY THEMES (oyuncunun sahip olduğu temalar) listesine otomatik olarak "Morning" (sabah) teması eklensin. ✅ Oyuncu oyun içinde hiçbir şey satın almasa bile varsayılan olarak Morning temasına sahip olsun. ✅ Oyun başladığında otomatik olarak arka plan Morning (sabah) temasıyla başlasın. Bu şekilde oyuncular mağazadan başka temalar almadıkça hep Morning temasına sahip olacak ve onu kullanabilecek. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
/****
* Plugins
****/
var storage = LK.import("@upit/storage.v1", {
diamonds: 0,
ownedBirds: ["classic"],
selectedBird: "classic",
lastDailyReward: 0,
ownedThemes: ["morning"],
selectedTheme: "morning"
});
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Bird = Container.expand(function () {
var self = Container.call(this);
self.velocity = 0;
self.gravity = 0.8;
self.flapPower = -15;
self.updateBirdSkin = function () {
if (self.birdGraphics) {
self.removeChild(self.birdGraphics);
}
var skinAsset = 'bird';
if (storage.selectedBird === 'diamondSword') {
skinAsset = 'diamondSwordBird';
} else if (storage.selectedBird === 'golden') {
skinAsset = 'goldenBird';
} else if (storage.selectedBird === 'fire') {
skinAsset = 'fireBird';
}
self.birdGraphics = self.attachAsset(skinAsset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 1.5
});
};
self.updateBirdSkin();
self.flap = function () {
self.velocity = self.flapPower;
LK.getSound('flap').play();
};
self.update = function () {
if (gameState !== 'playing') {
return;
}
self.velocity += self.gravity;
self.y += self.velocity;
// Rotate bird based on velocity
self.birdGraphics.rotation = Math.min(Math.max(self.velocity * 0.05, -0.5), 0.5);
// Ground collision
if (self.y > 2732 - 100 - 30) {
// Update high score if current score is higher
if (obstacleCount > highScore) {
highScore = obstacleCount;
storage.highScore = highScore;
}
LK.showGameOver();
}
// Screen boundary collision
if (self.y < 0) {
// Update high score if current score is higher
if (obstacleCount > highScore) {
highScore = obstacleCount;
storage.highScore = highScore;
}
LK.showGameOver();
}
};
return self;
});
var Diamond = Container.expand(function () {
var self = Container.call(this);
self.speed = -4;
self.collected = false;
var diamondGraphics = self.attachAsset('diamond', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.PI / 4,
scaleX: 2,
scaleY: 2
});
self.update = function () {
self.x += self.speed;
diamondGraphics.rotation += 0.1;
};
return self;
});
var GiftPanel = Container.expand(function () {
var self = Container.call(this);
var panel = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5
});
var titleText = new Text2('DAILY GIFT', {
size: 80,
fill: '#FFFFFF'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 0;
titleText.y = -800;
self.addChild(titleText);
// Check if daily reward is available (24 hours = 86400000 milliseconds)
var currentTime = Date.now();
var timeSinceLastReward = currentTime - (storage.lastDailyReward || 0);
var canClaimReward = timeSinceLastReward >= 86400000;
var giftIcon = self.addChild(LK.getAsset('diamond', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 8,
scaleY: 8,
x: 0,
y: -200
}));
var rewardText = new Text2('Daily Reward: 5 Diamonds', {
size: 50,
fill: '#FFD700'
});
rewardText.anchor.set(0.5, 0.5);
rewardText.x = 0;
rewardText.y = 0;
self.addChild(rewardText);
var statusText = new Text2(canClaimReward ? 'Available!' : 'Come back tomorrow!', {
size: 40,
fill: canClaimReward ? '#00FF00' : '#FF0000'
});
statusText.anchor.set(0.5, 0.5);
statusText.x = 0;
statusText.y = 100;
self.addChild(statusText);
var claimButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 300
}));
var claimButtonText = new Text2(canClaimReward ? 'CLAIM' : 'CLAIMED', {
size: 30,
fill: '#FFFFFF'
});
claimButtonText.anchor.set(0.5, 0.5);
claimButton.addChild(claimButtonText);
claimButton.down = function () {
if (canClaimReward) {
storage.diamonds += 5;
storage.lastDailyReward = currentTime;
diamondCountText.setText('Diamonds: ' + storage.diamonds);
claimButtonText.setText('CLAIMED');
statusText.setText('Come back tomorrow!');
statusText.fill = '#FF0000';
}
};
var creatorText = new Text2('Creator:ironx_creator0', {
size: 25,
fill: '#888888'
});
creatorText.anchor.set(0.5, 0.5);
creatorText.x = 0;
creatorText.y = 700;
self.addChild(creatorText);
var closeButton = self.addChild(LK.getAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 800
}));
var closeText = new Text2('CLOSE', {
size: 30,
fill: '#FFFFFF'
});
closeText.anchor.set(0.5, 0.5);
closeButton.addChild(closeText);
closeButton.down = function () {
self.destroy();
if (wasPlaying) {
startCountdown();
} else {
gameState = 'waiting';
tapToStartText.visible = true;
instructionText.visible = true;
}
};
return self;
});
var InventoryPanel = Container.expand(function () {
var self = Container.call(this);
// Create multiple layered backgrounds for frosted glass effect
var glassLayer1 = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x2C3E50,
alpha: 0.85
});
var glassLayer2 = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x34495E,
alpha: 0.6,
scaleX: 0.98,
scaleY: 0.98
});
var glassLayer3 = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x5D6D7E,
alpha: 0.4,
scaleX: 0.96,
scaleY: 0.96
});
// Create glowing edge effects
var glowEdge1 = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0xF1C40F,
alpha: 0.3,
scaleX: 1.02,
scaleY: 1.02
});
var glowEdge2 = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0xE67E22,
alpha: 0.2,
scaleX: 1.04,
scaleY: 1.04
});
// Create subtle shadow depth
var shadowLayer = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x000000,
alpha: 0.3,
scaleX: 1.01,
scaleY: 1.01,
x: 8,
y: 8
});
// Add animated sparkle particles for premium feel
var inventorySparkles = [];
for (var sp = 0; sp < 12; sp++) {
var sparkle = self.addChild(LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: (Math.random() - 0.5) * 1600,
y: (Math.random() - 0.5) * 1900,
scaleX: 0.3 + Math.random() * 0.8,
scaleY: 0.3 + Math.random() * 0.8,
alpha: 0.4 + Math.random() * 0.4,
tint: 0xF39C12
}));
sparkle.originalX = sparkle.x;
sparkle.originalY = sparkle.y;
sparkle.floatSpeed = 0.015 + Math.random() * 0.025;
sparkle.rotationSpeed = 0.03 + Math.random() * 0.06;
inventorySparkles.push(sparkle);
}
// Animate glow edges with gentle pulsing
tween(glowEdge1, {
alpha: 0.5,
scaleX: 1.03,
scaleY: 1.03
}, {
duration: 2500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(glowEdge1, {
alpha: 0.3,
scaleX: 1.02,
scaleY: 1.02
}, {
duration: 2500,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Restart animation
tween(glowEdge1, {
alpha: 0.5,
scaleX: 1.03,
scaleY: 1.03
}, {
duration: 2500,
easing: tween.easeInOut
});
}
});
}
});
tween(glowEdge2, {
alpha: 0.35,
scaleX: 1.05,
scaleY: 1.05
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(glowEdge2, {
alpha: 0.2,
scaleX: 1.04,
scaleY: 1.04
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Restart animation
tween(glowEdge2, {
alpha: 0.35,
scaleX: 1.05,
scaleY: 1.05
}, {
duration: 3000,
easing: tween.easeInOut
});
}
});
}
});
self.update = function () {
// Animate sparkle particles
for (var sp = 0; sp < inventorySparkles.length; sp++) {
var sparkle = inventorySparkles[sp];
sparkle.y += Math.sin(LK.ticks * sparkle.floatSpeed) * 0.3;
sparkle.rotation += sparkle.rotationSpeed;
sparkle.alpha = 0.4 + Math.sin(LK.ticks * sparkle.floatSpeed * 1.5) * 0.2;
}
};
var titleText = new Text2('INVENTORY', {
size: 80,
fill: '#FFFFFF'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 0;
titleText.y = -800;
self.addChild(titleText);
var highScoreText = new Text2('High Score: ' + highScore + ' obstacles', {
size: 50,
fill: '#FFD700'
});
highScoreText.anchor.set(0.5, 0.5);
highScoreText.x = 0;
highScoreText.y = 700;
self.addChild(highScoreText);
var birdTypes = [{
id: 'classic',
name: 'Classic Bird',
asset: 'bird'
}, {
id: 'diamondSword',
name: 'Diamond Sword Bird',
asset: 'diamondSwordBird'
}, {
id: 'golden',
name: 'Golden Bird',
asset: 'goldenBird'
}, {
id: 'fire',
name: 'Fire Bird',
asset: 'fireBird'
}];
var ownedIndex = 0;
for (var i = 0; i < birdTypes.length; i++) {
var birdType = birdTypes[i];
if (storage.ownedBirds.indexOf(birdType.id) >= 0) {
// Calculate position in 2x2 grid
var col = ownedIndex % 2; // 0 for left, 1 for right
var row = Math.floor(ownedIndex / 2); // 0 for top, 1 for bottom
var x = col === 0 ? -300 : 300; // Left or right position
var y = -400 + row * 400; // Top or bottom position with spacing
// Move golden bird and fire bird down by adjusting their y position
if (birdType.id === 'golden' || birdType.id === 'fire') {
y += 100; // Move these birds down by 100 pixels
}
// Create elegant pedestal for each bird slot
var pedestalShadow = self.addChild(LK.getAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
x: x + 3,
y: y + 3,
scaleX: 0.25,
scaleY: 0.25,
tint: 0x000000,
alpha: 0.4
}));
var pedestalBase = self.addChild(LK.getAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y,
scaleX: 0.25,
scaleY: 0.25,
tint: 0x2C3E50,
alpha: 0.8
}));
var pedestalGlow = self.addChild(LK.getAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y,
scaleX: 0.27,
scaleY: 0.27,
tint: 0xF1C40F,
alpha: 0.3
}));
// Golden rim for premium feel
var goldenRim = self.addChild(LK.getAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y,
scaleX: 0.26,
scaleY: 0.26,
tint: 0xD4AF37,
alpha: 0.6
}));
var birdPreview = self.addChild(LK.getAsset(birdType.asset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: x,
y: y
}));
// Add gentle floating animation to bird
var birdFloatSpeed = 0.02 + Math.random() * 0.01;
(function (bird, speed, baseY) {
var originalUpdate = bird.update || function () {};
bird.update = function () {
originalUpdate.call(bird);
bird.y = baseY + Math.sin(LK.ticks * speed) * 8;
};
})(birdPreview, birdFloatSpeed, y);
// Animate pedestal glow
tween(pedestalGlow, {
alpha: 0.5,
scaleX: 0.28,
scaleY: 0.28
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(pedestalGlow, {
alpha: 0.3,
scaleX: 0.27,
scaleY: 0.27
}, {
duration: 2000,
easing: tween.easeInOut
});
}
});
var birdNameText = new Text2(birdType.name, {
size: 40,
fill: '#F1C40F'
});
birdNameText.anchor.set(0.5, 0.5);
birdNameText.x = x;
birdNameText.y = y + 80;
self.addChild(birdNameText);
// Create elegant button background
var buttonShadow = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: x + 2,
y: y + 152,
tint: 0x000000,
alpha: 0.4
}));
var buttonBase = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y + 150,
tint: 0x2C3E50,
alpha: 0.9
}));
var buttonGlow = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: x,
y: y + 150,
tint: 0xE67E22,
alpha: 0.4,
scaleX: 1.1,
scaleY: 1.1
}));
var selectButton = buttonBase;
var selectText = new Text2(storage.selectedBird === birdType.id ? 'SELECTED' : 'SELECT', {
size: 30,
fill: storage.selectedBird === birdType.id ? '#F1C40F' : '#FFFFFF'
});
selectText.anchor.set(0.5, 0.5);
selectButton.addChild(selectText);
// Add hover effect animation
var isSelected = storage.selectedBird === birdType.id;
if (isSelected) {
tween(buttonGlow, {
alpha: 0.7,
scaleX: 1.15,
scaleY: 1.15
}, {
duration: 1500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(buttonGlow, {
alpha: 0.4,
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 1500,
easing: tween.easeInOut
});
}
});
}
(function (birdId, button, text) {
button.down = function () {
storage.selectedBird = birdId;
text.setText('SELECTED');
LK.getSound('select').play();
// Update other buttons
for (var j = 0; j < self.children.length; j++) {
var child = self.children[j];
if (child.children && child.children[0] && child.children[0].text && child.children[0].text.indexOf('SELECT') >= 0) {
if (child !== button) {
child.children[0].setText('SELECT');
}
}
}
};
})(birdType.id, selectButton, selectText);
ownedIndex++;
}
}
var closeButton = self.addChild(LK.getAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 800
}));
var closeText = new Text2('CLOSE', {
size: 30,
fill: '#FFFFFF'
});
closeText.anchor.set(0.5, 0.5);
closeButton.addChild(closeText);
closeButton.down = function () {
if (bird) {
bird.updateBirdSkin();
}
self.destroy();
if (wasPlaying) {
startCountdown();
} else {
gameState = 'waiting';
// Show tap to start UI when returning to waiting state
tapToStartText.visible = true;
instructionText.visible = true;
}
};
return self;
});
var MyThemesPanel = Container.expand(function () {
var self = Container.call(this);
var panel = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5
});
var titleText = new Text2('MY THEMES', {
size: 80,
fill: '#FFFFFF'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 0;
titleText.y = -800;
self.addChild(titleText);
var allThemes = [{
id: 'morning',
name: 'Morning Theme'
}, {
id: 'night',
name: 'Night Theme'
}, {
id: 'mars',
name: 'Mars Theme'
}];
// Morning Theme (left side)
if (storage.ownedThemes && storage.ownedThemes.indexOf('morning') >= 0) {
var morningIcon = self.addChild(LK.getAsset('sun', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: -300,
y: -200
}));
var morningNameText = new Text2('Morning Theme', {
size: 40,
fill: '#FFFFFF'
});
morningNameText.anchor.set(0.5, 0.5);
morningNameText.x = -300;
morningNameText.y = -120;
self.addChild(morningNameText);
var morningSelectButton = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: -300,
y: -50
}));
var morningSelectText = new Text2(storage.selectedTheme === 'morning' ? 'SELECTED' : 'SELECT', {
size: 30,
fill: '#FFFFFF'
});
morningSelectText.anchor.set(0.5, 0.5);
morningSelectButton.addChild(morningSelectText);
morningSelectButton.down = function () {
storage.selectedTheme = 'morning';
morningSelectText.setText('SELECTED');
LK.getSound('select').play();
// Update night button text
if (nightSelectText) {
nightSelectText.setText('SELECT');
}
// Apply theme immediately
applyTheme('morning');
};
}
// Night Theme (right side)
if (storage.ownedThemes && storage.ownedThemes.indexOf('night') >= 0) {
var nightIcon = self.addChild(LK.getAsset('nightIcon', {
anchorX: 0.5,
anchorY: 0.5,
x: 300,
y: -200
}));
var nightNameText = new Text2('Night Theme', {
size: 40,
fill: '#FFFFFF'
});
nightNameText.anchor.set(0.5, 0.5);
nightNameText.x = 300;
nightNameText.y = -120;
self.addChild(nightNameText);
var nightSelectButton = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 300,
y: -50
}));
var nightSelectText = new Text2(storage.selectedTheme === 'night' ? 'SELECTED' : 'SELECT', {
size: 30,
fill: '#FFFFFF'
});
nightSelectText.anchor.set(0.5, 0.5);
nightSelectButton.addChild(nightSelectText);
nightSelectButton.down = function () {
storage.selectedTheme = 'night';
nightSelectText.setText('SELECTED');
LK.getSound('select').play();
// Update morning button text
if (morningSelectText) {
morningSelectText.setText('SELECT');
}
// Apply theme immediately
applyTheme('night');
};
}
// Mars Theme (bottom center)
if (storage.ownedThemes && storage.ownedThemes.indexOf('mars') >= 0) {
var marsIcon = self.addChild(LK.getAsset('marsIcon', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.2,
scaleY: 1.2,
x: 0,
y: 200
}));
var marsNameText = new Text2('Mars Theme', {
size: 40,
fill: '#FFFFFF'
});
marsNameText.anchor.set(0.5, 0.5);
marsNameText.x = 0;
marsNameText.y = 280;
self.addChild(marsNameText);
var marsSelectButton = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 350
}));
var marsSelectText = new Text2(storage.selectedTheme === 'mars' ? 'SELECTED' : 'SELECT', {
size: 30,
fill: '#FFFFFF'
});
marsSelectText.anchor.set(0.5, 0.5);
marsSelectButton.addChild(marsSelectText);
marsSelectButton.down = function () {
storage.selectedTheme = 'mars';
marsSelectText.setText('SELECTED');
LK.getSound('select').play();
// Update other button texts
if (morningSelectText) {
morningSelectText.setText('SELECT');
}
if (nightSelectText) {
nightSelectText.setText('SELECT');
}
// Apply theme immediately
applyTheme('mars');
};
}
var closeButton = self.addChild(LK.getAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 800
}));
var closeText = new Text2('CLOSE', {
size: 30,
fill: '#FFFFFF'
});
closeText.anchor.set(0.5, 0.5);
closeButton.addChild(closeText);
closeButton.down = function () {
self.destroy();
if (wasPlaying) {
startCountdown();
} else {
gameState = 'waiting';
tapToStartText.visible = true;
instructionText.visible = true;
}
};
return self;
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
self.speed = -4;
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
self.update = function () {
self.x += self.speed;
};
return self;
});
var ShopPanel = Container.expand(function () {
var self = Container.call(this);
var panel = self.attachAsset('shopPanel', {
anchorX: 0.5,
anchorY: 0.5
});
// Create vibrant gradient background layers
var gradientLayer1 = self.attachAsset('shopPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x6A0DAD,
alpha: 0.8
});
var gradientLayer2 = self.attachAsset('shopPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0xFF1493,
alpha: 0.4,
scaleX: 0.9,
scaleY: 0.9
});
var gradientLayer3 = self.attachAsset('shopPanel', {
anchorX: 0.5,
anchorY: 0.5,
tint: 0x00CED1,
alpha: 0.3,
scaleX: 0.8,
scaleY: 0.8
});
// Create animated sparkle particles
var sparkleParticles = [];
for (var sp = 0; sp < 20; sp++) {
var sparkle = self.addChild(LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: (Math.random() - 0.5) * 1600,
y: (Math.random() - 0.5) * 2000,
scaleX: 0.5 + Math.random() * 1.5,
scaleY: 0.5 + Math.random() * 1.5,
alpha: 0.6 + Math.random() * 0.4,
tint: 0xFFD700
}));
sparkle.originalX = sparkle.x;
sparkle.originalY = sparkle.y;
sparkle.floatSpeed = 0.02 + Math.random() * 0.03;
sparkle.rotationSpeed = 0.05 + Math.random() * 0.1;
sparkleParticles.push(sparkle);
}
// Create flowing light streaks
var lightStreaks = [];
for (var ls = 0; ls < 8; ls++) {
var streak = self.addChild(LK.getAsset('diamond', {
anchorX: 0.5,
anchorY: 0.5,
x: (Math.random() - 0.5) * 1800,
y: (Math.random() - 0.5) * 2200,
scaleX: 3 + Math.random() * 2,
scaleY: 0.3,
alpha: 0.3 + Math.random() * 0.3,
tint: 0x00FFFF,
rotation: Math.random() * Math.PI * 2
}));
streak.originalX = streak.x;
streak.flowSpeed = 0.01 + Math.random() * 0.02;
lightStreaks.push(streak);
}
// Animate gradient layers with pulsing effect
tween(gradientLayer2, {
scaleX: 1.1,
scaleY: 1.1,
alpha: 0.6
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(gradientLayer2, {
scaleX: 0.9,
scaleY: 0.9,
alpha: 0.4
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Restart animation
tween(gradientLayer2, {
scaleX: 1.1,
scaleY: 1.1,
alpha: 0.6
}, {
duration: 2000,
easing: tween.easeInOut
});
}
});
}
});
tween(gradientLayer3, {
scaleX: 1.0,
scaleY: 1.0,
alpha: 0.5
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(gradientLayer3, {
scaleX: 0.8,
scaleY: 0.8,
alpha: 0.3
}, {
duration: 3000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Restart animation
tween(gradientLayer3, {
scaleX: 1.0,
scaleY: 1.0,
alpha: 0.5
}, {
duration: 3000,
easing: tween.easeInOut
});
}
});
}
});
self.update = function () {
// Animate sparkle particles
for (var sp = 0; sp < sparkleParticles.length; sp++) {
var sparkle = sparkleParticles[sp];
sparkle.y += Math.sin(LK.ticks * sparkle.floatSpeed) * 0.5;
sparkle.rotation += sparkle.rotationSpeed;
sparkle.alpha = 0.6 + Math.sin(LK.ticks * sparkle.floatSpeed * 2) * 0.3;
}
// Animate light streaks
for (var ls = 0; ls < lightStreaks.length; ls++) {
var streak = lightStreaks[ls];
streak.x += Math.cos(LK.ticks * streak.flowSpeed) * 2;
streak.alpha = 0.3 + Math.sin(LK.ticks * streak.flowSpeed * 3) * 0.2;
streak.rotation += 0.01;
}
};
var titleText = new Text2('BIRD SHOP', {
size: 80,
fill: '#FFFFFF'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 0;
titleText.y = -800;
self.addChild(titleText);
var diamondText = new Text2('Diamonds: ' + storage.diamonds, {
size: 50,
fill: '#00FFFF'
});
diamondText.anchor.set(0.5, 0.5);
diamondText.x = 0;
diamondText.y = -700;
self.addChild(diamondText);
// BIRDS category title
var birdsTitle = new Text2('BIRDS', {
size: 60,
fill: '#FFD700'
});
birdsTitle.anchor.set(0.5, 0.5);
birdsTitle.x = 0;
birdsTitle.y = -500;
self.addChild(birdsTitle);
// Diamond Sword Bird (left side)
var diamondSwordBirdPreview = self.addChild(LK.getAsset('diamondSwordBird', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: -300,
y: -200
}));
var diamondSwordText = new Text2('Diamond Sword Bird\n100 Diamonds', {
size: 30,
fill: '#FFFFFF'
});
diamondSwordText.anchor.set(0.5, 0.5);
diamondSwordText.x = -300;
diamondSwordText.y = -100;
self.addChild(diamondSwordText);
var diamondSwordButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: -300,
y: 0
}));
var diamondSwordButtonText = new Text2(storage.ownedBirds.indexOf('diamondSword') >= 0 ? 'OWNED' : 'BUY', {
size: 25,
fill: '#FFFFFF'
});
diamondSwordButtonText.anchor.set(0.5, 0.5);
diamondSwordButton.addChild(diamondSwordButtonText);
diamondSwordButton.down = function () {
if (storage.ownedBirds.indexOf('diamondSword') < 0 && storage.diamonds >= 100) {
storage.diamonds -= 100;
storage.ownedBirds.push('diamondSword');
diamondSwordButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('purchase').play();
}
};
// Golden Bird (center position)
var goldenBirdPreview = self.addChild(LK.getAsset('goldenBird', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: 0,
y: -200
}));
var goldenText = new Text2('Golden Bird\n200 Diamonds', {
size: 30,
fill: '#FFFFFF'
});
goldenText.anchor.set(0.5, 0.5);
goldenText.x = 0;
goldenText.y = -100;
self.addChild(goldenText);
var goldenButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 0
}));
var goldenButtonText = new Text2(storage.ownedBirds.indexOf('golden') >= 0 ? 'OWNED' : 'BUY', {
size: 25,
fill: '#FFFFFF'
});
goldenButtonText.anchor.set(0.5, 0.5);
goldenButton.addChild(goldenButtonText);
goldenButton.down = function () {
if (storage.ownedBirds.indexOf('golden') < 0 && storage.diamonds >= 200) {
storage.diamonds -= 200;
storage.ownedBirds.push('golden');
goldenButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('purchase').play();
}
};
// Fire Bird (right side)
var fireBirdPreview = self.addChild(LK.getAsset('fireBird', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: 300,
y: -200
}));
var fireText = new Text2('Fire Bird\n400 Diamonds', {
size: 30,
fill: '#FFFFFF'
});
fireText.anchor.set(0.5, 0.5);
fireText.x = 300;
fireText.y = -100;
self.addChild(fireText);
var fireButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 300,
y: 0
}));
var fireButtonText = new Text2(storage.ownedBirds.indexOf('fire') >= 0 ? 'OWNED' : 'BUY', {
size: 25,
fill: '#FFFFFF'
});
fireButtonText.anchor.set(0.5, 0.5);
fireButton.addChild(fireButtonText);
fireButton.down = function () {
if (storage.ownedBirds.indexOf('fire') < 0 && storage.diamonds >= 400) {
storage.diamonds -= 400;
storage.ownedBirds.push('fire');
fireButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('purchase').play();
}
};
// THEMES category title
var themesTitle = new Text2('THEMES', {
size: 60,
fill: '#FFD700'
});
themesTitle.anchor.set(0.5, 0.5);
themesTitle.x = 0;
themesTitle.y = 200;
self.addChild(themesTitle);
// Morning Theme (left side)
var morningThemeIcon = self.addChild(LK.getAsset('sun', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: -400,
y: 400
}));
var morningText = new Text2('Morning Theme\nFREE', {
size: 30,
fill: '#FFFFFF'
});
morningText.anchor.set(0.5, 0.5);
morningText.x = -400;
morningText.y = 500;
self.addChild(morningText);
var morningButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: -400,
y: 600
}));
var morningButtonText = new Text2('OWNED', {
size: 25,
fill: '#FFFFFF'
});
morningButtonText.anchor.set(0.5, 0.5);
morningButton.addChild(morningButtonText);
morningButton.down = function () {
// Morning theme is always free and owned
};
// Night Theme (center position) - Create a night icon with dark colors
var nightThemeIcon = self.addChild(LK.getAsset('nightIcon', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 400
}));
// Add stars to the night icon
var star1 = self.addChild(LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: -20,
y: 380
}));
var star2 = self.addChild(LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: 15,
y: 370
}));
var star3 = self.addChild(LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: -10,
y: 420
}));
// Add a moon to complete the night theme
var moon = self.addChild(LK.getAsset('moon', {
anchorX: 0.5,
anchorY: 0.5,
x: 25,
y: 385
}));
var nightText = new Text2('Night Theme\n800 Diamonds', {
size: 30,
fill: '#FFFFFF'
});
nightText.anchor.set(0.5, 0.5);
nightText.x = 0;
nightText.y = 500;
self.addChild(nightText);
var nightButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 600
}));
var nightButtonText = new Text2(storage.ownedThemes && storage.ownedThemes.indexOf('night') >= 0 ? 'OWNED' : 'BUY', {
size: 25,
fill: '#FFFFFF'
});
nightButtonText.anchor.set(0.5, 0.5);
nightButton.addChild(nightButtonText);
nightButton.down = function () {
if (!storage.ownedThemes) storage.ownedThemes = [];
if (storage.ownedThemes.indexOf('night') < 0 && storage.diamonds >= 800) {
storage.diamonds -= 800;
storage.ownedThemes.push('night');
nightButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('purchase').play();
}
};
// Mars Theme (right side) - Create Mars theme with red planet appearance
var marsThemeIcon = self.addChild(LK.getAsset('marsIcon', {
anchorX: 0.5,
anchorY: 0.5,
x: 400,
y: 400,
scaleX: 1.5,
scaleY: 1.5
}));
var marsText = new Text2('Mars Theme\n1500 Diamonds', {
size: 30,
fill: '#FFFFFF'
});
marsText.anchor.set(0.5, 0.5);
marsText.x = 400;
marsText.y = 500;
self.addChild(marsText);
var marsButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 400,
y: 600
}));
var marsButtonText = new Text2(storage.ownedThemes && storage.ownedThemes.indexOf('mars') >= 0 ? 'OWNED' : 'BUY', {
size: 25,
fill: '#FFFFFF'
});
marsButtonText.anchor.set(0.5, 0.5);
marsButton.addChild(marsButtonText);
marsButton.down = function () {
if (!storage.ownedThemes) storage.ownedThemes = [];
if (storage.ownedThemes.indexOf('mars') < 0 && storage.diamonds >= 1500) {
storage.diamonds -= 1500;
storage.ownedThemes.push('mars');
marsButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('purchase').play();
}
};
var closeButton = self.addChild(LK.getAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 800
}));
var closeText = new Text2('CLOSE', {
size: 30,
fill: '#FFFFFF'
});
closeText.anchor.set(0.5, 0.5);
closeButton.addChild(closeText);
closeButton.down = function () {
self.destroy();
if (wasPlaying) {
startCountdown();
} else {
gameState = 'waiting';
// Show tap to start UI when returning to waiting state
tapToStartText.visible = true;
instructionText.visible = true;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Ensure Morning theme is always owned (for existing players)
if (!storage.ownedThemes) {
storage.ownedThemes = ["morning"];
}
if (storage.ownedThemes.indexOf("morning") < 0) {
storage.ownedThemes.push("morning");
}
var bird;
var obstacles = [];
var diamonds = [];
var ground;
var gameState = 'waiting'; // Start with waiting state
var obstacleTimer = 0;
var diamondTimer = 0;
var obstacleCount = 0;
var isCountingDown = false;
var countdownValue = 3;
var wasPlaying = false; // Track if game was playing before opening panels
var highScore = storage.highScore || 0; // Track highest obstacle count reached
// Theme elements
var backgroundSun;
var backgroundMoon;
var backgroundStars = [];
var marsDustClouds = [];
var marsSparkleStars = [];
function applyTheme(themeId) {
if (themeId === 'morning') {
// Morning theme - light blue sky with sun
game.setBackgroundColor(0x87CEEB);
// Show sun, hide moon and stars
if (backgroundSun) backgroundSun.visible = true;
if (backgroundMoon) backgroundMoon.visible = false;
for (var s = 0; s < backgroundStars.length; s++) {
backgroundStars[s].visible = false;
}
// Show clouds in morning theme
for (var c = 0; c < clouds.length; c++) {
clouds[c].visible = true;
}
// Hide mars dust clouds in morning theme
for (var d = 0; d < marsDustClouds.length; d++) {
marsDustClouds[d].visible = false;
}
} else if (themeId === 'night') {
// Night theme - dark sky with moon and stars
game.setBackgroundColor(0x191970);
// Hide sun, show moon and stars
if (backgroundSun) backgroundSun.visible = false;
if (backgroundMoon) backgroundMoon.visible = true;
for (var s = 0; s < backgroundStars.length; s++) {
backgroundStars[s].visible = true;
}
// Hide clouds in night theme
for (var c = 0; c < clouds.length; c++) {
clouds[c].visible = false;
}
} else if (themeId === 'mars') {
// Mars theme - reddish orange sky
game.setBackgroundColor(0xCD853F);
// Hide sun and moon, show specific mars elements
if (backgroundSun) backgroundSun.visible = false;
if (backgroundMoon) backgroundMoon.visible = false;
for (var s = 0; s < backgroundStars.length; s++) {
backgroundStars[s].visible = false;
}
// Hide regular clouds, show mars dust clouds
for (var c = 0; c < clouds.length; c++) {
clouds[c].visible = false;
}
for (var d = 0; d < marsDustClouds.length; d++) {
marsDustClouds[d].visible = true;
}
// Show mars sparkle stars
for (var ms = 0; ms < marsSparkleStars.length; ms++) {
marsSparkleStars[ms].visible = true;
}
}
}
// UI Elements
var diamondCountText = new Text2('Diamonds: ' + storage.diamonds, {
size: 40,
fill: '#00FFFF'
});
diamondCountText.anchor.set(1, 1);
LK.gui.bottomRight.addChild(diamondCountText);
var obstacleCountText = new Text2('Obstacle: 0', {
size: 50,
fill: '#FFFFFF'
});
obstacleCountText.anchor.set(0.5, 0);
obstacleCountText.y = 100; // Position below the top to avoid platform menu
LK.gui.top.addChild(obstacleCountText);
var shopButton = LK.getAsset('shopButton', {
anchorX: 0,
anchorY: 1,
x: 0,
y: 0
});
var shopButtonText = new Text2('SHOP', {
size: 25,
fill: '#FFFFFF'
});
shopButtonText.anchor.set(0.5, 0.5);
shopButton.addChild(shopButtonText);
LK.gui.bottomLeft.addChild(shopButton);
var myThemesButton = LK.getAsset('themesButton', {
anchorX: 0,
anchorY: 1,
x: 170,
y: 0
});
var myThemesButtonText = new Text2('MY THEMES', {
size: 20,
fill: '#FFFFFF'
});
myThemesButtonText.anchor.set(0.5, 0.5);
myThemesButton.addChild(myThemesButtonText);
LK.gui.bottomLeft.addChild(myThemesButton);
var inventoryButton = LK.getAsset('inventoryButton', {
anchorX: 1,
anchorY: 0
});
var inventoryButtonText = new Text2('INVENTORY', {
size: 20,
fill: '#FFFFFF'
});
inventoryButtonText.anchor.set(0.5, 0.5);
inventoryButton.addChild(inventoryButtonText);
LK.gui.topRight.addChild(inventoryButton);
// Position inventory button below diamond counter
inventoryButton.y = 60;
var giftButton = LK.getAsset('giftButton', {
anchorX: 1,
anchorY: 0
});
var giftButtonText = new Text2('GIFT', {
size: 20,
fill: '#FFFFFF'
});
giftButtonText.anchor.set(0.5, 0.5);
giftButton.addChild(giftButtonText);
LK.gui.topRight.addChild(giftButton);
// Position gift button below inventory button
giftButton.y = 160;
// Tap to start UI
var tapToStartText = new Text2('TAP TO START', {
size: 80,
fill: '#FFFFFF'
});
tapToStartText.anchor.set(0.5, 0.5);
LK.gui.center.addChild(tapToStartText);
var instructionText = new Text2('Tap screen to flap\nAvoid obstacles\nCollect diamonds', {
size: 40,
fill: '#FFFFFF'
});
instructionText.anchor.set(0.5, 0.5);
instructionText.y = 100;
LK.gui.center.addChild(instructionText);
// Countdown text for resume
var countdownText = new Text2('3', {
size: 200,
fill: '#FFFF00'
});
countdownText.anchor.set(0.5, 0.5);
countdownText.visible = false;
LK.gui.center.addChild(countdownText);
shopButton.down = function () {
if (gameState === 'playing' || gameState === 'waiting') {
wasPlaying = gameState === 'playing';
gameState = 'shop';
// Hide tap to start UI when opening shop
tapToStartText.visible = false;
instructionText.visible = false;
var shopPanel = new ShopPanel();
shopPanel.x = 1024;
shopPanel.y = 1366;
game.addChild(shopPanel);
}
// Update clouds - move them slowly across screen
for (var k = clouds.length - 1; k >= 0; k--) {
var cloud = clouds[k];
cloud.x += cloud.speed;
// Respawn cloud on the right when it goes off-screen
if (cloud.x < -120) {
cloud.x = 2048 + 120;
cloud.y = Math.random() * 1500 + 200;
cloud.scaleX = 0.8 + Math.random() * 0.6;
cloud.scaleY = 0.8 + Math.random() * 0.6;
cloud.speed = -0.5 - Math.random() * 1;
}
}
// Update Mars dust clouds
for (var md = 0; md < marsDustClouds.length; md++) {
var dustCloud = marsDustClouds[md];
if (dustCloud.visible) {
dustCloud.x += dustCloud.speed;
if (dustCloud.x < -120) {
dustCloud.x = 2048 + 120;
dustCloud.y = Math.random() * 1800 + 400;
dustCloud.scaleX = 0.6 + Math.random() * 0.8;
dustCloud.scaleY = 0.6 + Math.random() * 0.8;
dustCloud.speed = -0.3 - Math.random() * 0.7;
}
}
}
// Update Mars sparkle stars
for (var mst = 0; mst < marsSparkleStars.length; mst++) {
var sparkle = marsSparkleStars[mst];
if (sparkle.visible) {
sparkle.alpha = sparkle.originalAlpha + Math.sin(LK.ticks * sparkle.twinkleSpeed) * 0.3;
}
}
};
inventoryButton.down = function () {
if (gameState === 'playing' || gameState === 'waiting') {
wasPlaying = gameState === 'playing';
gameState = 'inventory';
// Hide tap to start UI when opening inventory
tapToStartText.visible = false;
instructionText.visible = false;
var inventoryPanel = new InventoryPanel();
inventoryPanel.x = 1024;
inventoryPanel.y = 1366;
game.addChild(inventoryPanel);
}
};
giftButton.down = function () {
if (gameState === 'playing' || gameState === 'waiting') {
wasPlaying = gameState === 'playing';
gameState = 'gift';
// Hide tap to start UI when opening gift panel
tapToStartText.visible = false;
instructionText.visible = false;
var giftPanel = new GiftPanel();
giftPanel.x = 1024;
giftPanel.y = 1366;
game.addChild(giftPanel);
}
};
myThemesButton.down = function () {
if (gameState === 'playing' || gameState === 'waiting') {
wasPlaying = gameState === 'playing';
gameState = 'mythemes';
// Hide tap to start UI when opening my themes panel
tapToStartText.visible = false;
instructionText.visible = false;
var myThemesPanel = new MyThemesPanel();
myThemesPanel.x = 1024;
myThemesPanel.y = 1366;
game.addChild(myThemesPanel);
}
};
// Initialize bird
bird = new Bird();
bird.x = 300;
bird.y = 1366;
game.addChild(bird);
// Initialize ground
ground = LK.getAsset('ground', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 2732 - 100
});
game.addChild(ground);
// Initialize background clouds
var clouds = [];
for (var c = 0; c < 6; c++) {
var cloud = LK.getAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5,
x: Math.random() * 2048,
y: Math.random() * 1500 + 200,
scaleX: 0.8 + Math.random() * 0.6,
scaleY: 0.8 + Math.random() * 0.6,
alpha: 0.7
});
cloud.speed = -0.5 - Math.random() * 1;
clouds.push(cloud);
game.addChild(cloud);
}
// Initialize theme background elements
backgroundSun = LK.getAsset('sun', {
anchorX: 0.5,
anchorY: 0.5,
x: 1800,
y: 300,
scaleX: 1.5,
scaleY: 1.5,
alpha: 0.8
});
game.addChild(backgroundSun);
backgroundMoon = LK.getAsset('moon', {
anchorX: 0.5,
anchorY: 0.5,
x: 1800,
y: 300,
scaleX: 3,
scaleY: 3,
alpha: 0.9,
visible: false
});
game.addChild(backgroundMoon);
// Create background stars
for (var st = 0; st < 15; st++) {
var star = LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: Math.random() * 2048,
y: Math.random() * 1000 + 100,
scaleX: 1 + Math.random() * 2,
scaleY: 1 + Math.random() * 2,
alpha: 0.7 + Math.random() * 0.3,
visible: false
});
backgroundStars.push(star);
game.addChild(star);
}
// Create Mars dust clouds
for (var md = 0; md < 8; md++) {
var dustCloud = LK.getAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5,
x: Math.random() * 2048,
y: Math.random() * 1800 + 400,
scaleX: 0.6 + Math.random() * 0.8,
scaleY: 0.6 + Math.random() * 0.8,
alpha: 0.3 + Math.random() * 0.3,
tint: 0xD2691E,
visible: false
});
dustCloud.speed = -0.3 - Math.random() * 0.7;
marsDustClouds.push(dustCloud);
game.addChild(dustCloud);
}
// Create Mars sparkle stars
for (var mst = 0; mst < 10; mst++) {
var sparkleVar = LK.getAsset('star', {
anchorX: 0.5,
anchorY: 0.5,
x: Math.random() * 2048,
y: Math.random() * 800 + 100,
scaleX: 0.8 + Math.random() * 1.5,
scaleY: 0.8 + Math.random() * 1.5,
alpha: 0.8 + Math.random() * 0.2,
tint: 0xFFD700,
visible: false
});
sparkleVar.twinkleSpeed = 0.02 + Math.random() * 0.03;
sparkleVar.originalAlpha = sparkleVar.alpha;
marsSparkleStars.push(sparkleVar);
game.addChild(sparkleVar);
}
// Apply initial theme
applyTheme(storage.selectedTheme || 'morning');
function startCountdown() {
isCountingDown = true;
countdownValue = 3;
countdownText.setText(countdownValue.toString());
countdownText.visible = true;
countdownText.alpha = 1;
countdownText.scaleX = 1;
countdownText.scaleY = 1;
function showNumber() {
countdownText.setText(countdownValue.toString());
countdownText.alpha = 1;
countdownText.scaleX = 2;
countdownText.scaleY = 2;
tween(countdownText, {
alpha: 0.3,
scaleX: 1,
scaleY: 1
}, {
duration: 800,
easing: tween.easeOut,
onFinish: function onFinish() {
countdownValue--;
if (countdownValue > 0) {
showNumber();
} else {
countdownText.visible = false;
isCountingDown = false;
gameState = 'playing';
}
}
});
}
showNumber();
}
game.down = function (x, y, obj) {
if (gameState === 'waiting') {
// Start the game
gameState = 'playing';
// Reset obstacle counter
obstacleCount = 0;
obstacleCountText.setText('Obstacle: 0');
// Hide tap to start UI
tapToStartText.visible = false;
instructionText.visible = false;
// Start background music
LK.playMusic('bgmusic');
} else if (gameState === 'playing') {
bird.flap();
}
};
game.update = function () {
if (gameState === 'waiting') {
// Animate tap to start text
tapToStartText.y = Math.sin(LK.ticks * 0.1) * 20;
// Don't update game mechanics while waiting
return;
}
if (gameState !== 'playing' || isCountingDown || gameState === 'shop' || gameState === 'inventory' || gameState === 'gift' || gameState === 'mythemes') {
return;
}
// Spawn obstacles
obstacleTimer++;
if (obstacleTimer >= 90) {
// Every 1.5 seconds at 60fps - faster spawn rate
obstacleTimer = 0;
// Create gap in middle
var gapSize = 320; // Further increased gap size for easier gameplay
var gapCenter = Math.random() * (2732 - 200 - gapSize) + 100 + gapSize / 2;
// Top obstacle
var topObstacle = new Obstacle();
topObstacle.x = 2048 + 40;
topObstacle.y = gapCenter - gapSize / 2 - 200;
obstacles.push(topObstacle);
game.addChild(topObstacle);
// Bottom obstacle
var bottomObstacle = new Obstacle();
bottomObstacle.x = 2048 + 40;
bottomObstacle.y = gapCenter + gapSize / 2 + 200;
obstacles.push(bottomObstacle);
game.addChild(bottomObstacle);
}
// Spawn diamonds
diamondTimer++;
if (diamondTimer >= 90) {
// Every 1.5 seconds
diamondTimer = 0;
var diamond = new Diamond();
diamond.x = 2048 + 15;
diamond.y = Math.random() * (2732 - 300) + 150;
diamonds.push(diamond);
game.addChild(diamond);
}
// Update and check obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
var obstacle = obstacles[i];
// Check if bird passed this obstacle (from right to left)
if (obstacle.lastX === undefined) obstacle.lastX = obstacle.x;
if (obstacle.lastX > bird.x && obstacle.x <= bird.x && !obstacle.passed) {
obstacle.passed = true;
// Only count every second obstacle (since we create pairs)
if (i % 2 === 0) {
obstacleCount++;
obstacleCountText.setText('Obstacle: ' + obstacleCount);
}
}
obstacle.lastX = obstacle.x;
if (obstacle.x < -100) {
obstacle.destroy();
obstacles.splice(i, 1);
continue;
}
// Collision with bird - check with scaled bird size
var birdBounds = {
left: bird.x - 60 * 1.5 / 2,
right: bird.x + 60 * 1.5 / 2,
top: bird.y - 60 * 1.5 / 2,
bottom: bird.y + 60 * 1.5 / 2
};
var obstacleBounds = {
left: obstacle.x - 40,
right: obstacle.x + 40,
top: obstacle.y - 200,
bottom: obstacle.y + 200
};
if (birdBounds.right > obstacleBounds.left && birdBounds.left < obstacleBounds.right && birdBounds.bottom > obstacleBounds.top && birdBounds.top < obstacleBounds.bottom) {
// Update high score if current score is higher
if (obstacleCount > highScore) {
highScore = obstacleCount;
storage.highScore = highScore;
}
LK.showGameOver();
return;
}
}
// Update and check diamonds
for (var j = diamonds.length - 1; j >= 0; j--) {
var diamond = diamonds[j];
if (diamond.x < -50) {
diamond.destroy();
diamonds.splice(j, 1);
continue;
}
// Collection by bird
if (!diamond.collected && bird.intersects(diamond)) {
diamond.collected = true;
storage.diamonds++;
diamondCountText.setText('Diamonds: ' + storage.diamonds);
LK.getSound('collect').play();
diamond.destroy();
diamonds.splice(j, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -366,8 +366,12 @@
var col = ownedIndex % 2; // 0 for left, 1 for right
var row = Math.floor(ownedIndex / 2); // 0 for top, 1 for bottom
var x = col === 0 ? -300 : 300; // Left or right position
var y = -400 + row * 400; // Top or bottom position with spacing
+ // Move golden bird and fire bird down by adjusting their y position
+ if (birdType.id === 'golden' || birdType.id === 'fire') {
+ y += 100; // Move these birds down by 100 pixels
+ }
// Create elegant pedestal for each bird slot
var pedestalShadow = self.addChild(LK.getAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5,
oyunlardaki kuş. In-Game asset. 2d. High contrast. No shadows
oyunlardaki satın alma butonu. In-Game asset. 2d. High contrast. No shadows
oyunlardaki çarpı butonu. In-Game asset. 2d. High contrast. No shadows
oyunlardaki mavi elmas. In-Game asset. 2d. High contrast. No shadows
oyunlardaki elmas kılıç taşıyan elmas kuş. In-Game asset. 2d. High contrast. No shadows
oyunlardaki altın kuş. In-Game asset. 2d. High contrast. No shadows
oyunlardaki envanter butonu. In-Game asset. 2d. High contrast. No shadows
oyunlardaki market ikonu. In-Game asset. 2d. High contrast. No shadows
oyunlarda hediye veren aryüzün simgesi. In-Game asset. 2d. High contrast. No shadows
oyunlardaki bulut. In-Game asset. 2d. High contrast. No shadows
Öyle bir şey istiyorumki oyunlardaki gibi böyle oraya tıklarsın temalar açılır ya temaları andıran birşey. In-Game asset. 2d. High contrast. No shadows
oyunlardaki güneş. In-Game asset. 2d. High contrast. No shadows
oyunlardaki beyaz ay. In-Game asset. 2d. High contrast. No shadows
oyunlardaki gece oldugu zaman yıldız. In-Game asset. 2d. High contrast. No shadows
oyunlardaki Use yazısı. In-Game asset. 2d. High contrast. No shadows
mars gezegeni. In-Game asset. 2d. High contrast. No shadows
oyunlardaki ateş kuş. In-Game asset. 2d. High contrast. No shadows