User prompt
Themese Morning ekle her oyuna başlayanda olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Themeslere Gündüz ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
birde temalara otomatikten gündüz ekle gündüzde önceki tema klasik olan ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyunumda temalar var. Temalardan biri Night. Oyuncu mağazadan Night temasını satın alıp envantere ekledikten sonra, envanterden Knight 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ü). Ayrıca Night teması seçili mi diye kontrol eden bir değişken oluştur (örneğin currentTheme == "Night" gibi) ve sahne buna göre sürekli güncellensin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Marketteki themeslerden birşey alırsan hemen yanındaki THEMES yerine gitsin tammamı ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Marketin yanındaki ikonu ben düzenlicem. imagese koyarmısın
User prompt
Sol alttaki marketin tam yanına bir arayüz koy Simgeyi bana sal ikonu ben koyucam. O arayüze tıklayınca THEMES diye bir açılcak marketten satın aldığımız THEMESLER ordaki arayüze gidecek ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Themesteki yerdeki NİGHT buy yerine SEÇ yazsın
User prompt
Marketin yanına bir ikon ekle bir arayüz oraya tıklayın arayüz açılsın ve arayüzde THEMES yazsın orayı kapatmak için çarpı koymayı unutma
User prompt
arkaya biraz bulut ekle
User prompt
NİGHT'ı bir ikon yap
User prompt
biraz daha alta koy NİGHT'ı çünkü THEMES gözükmüyor
User prompt
Themes kategorisine Night eklermisin 800 elmas olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
bir tane daha kategori ekle o kategorinin ismi THEMES olsun onuda alta koy. çarpı butonunuda bird shopun yanına koy
User prompt
Şimdi markette kuşları yan yana bir kategoriye koy yani demek istediğim BİRDS diye bir yazı olsun üstte alttada yan yana Elmas kılıç kuş ve altın kuş olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
market bölümüne THEMES kategorisi ekle o kategorinin içindede NİGHT olsun 800 elmasa fotoğrafını ben koyarım ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
her oyuna giren 0 elmasla başlasın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyunu 1 kat hızlandır
User prompt
daily giftte hediye olan 5 elması almak için bir buton oluştur ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
envanter ikonun biraz altında bir hediye arayüzü olsun oraya girince günlük 5 elmas versin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
her oyun guncelledıgınde 1000 elmas verme hiç elmas verme
User prompt
marketi ve envanteri açınca oyun dursn
User prompt
envanteri açtığında altta biyerde şuana kadar geçtiği rekor yazın yani şuana kadar en fazla kaç blok geşmişse rekor olarak yazsın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyundayken mağaza,envanteri yada oyunu durdurursak geri kapattığımızda 3 ten geri saysın ve oyun kaldığı yerden başlasın. 3 ten geri sayarkende oyun tamamen donsun sayma bitince oyun kaldıgı yerden devam etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyundayken mağaza,envanteri yada oyunu durdurursak 3 ten geriye doğru saysın tam ortada 3 ten geri sayarkende oyun donsun sayma bittiğinde geri oyun başlasın kaldığı yerden ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/****
* Plugins
****/
var storage = LK.import("@upit/storage.v1", {
diamonds: 0,
ownedBirds: ["classic"],
selectedBird: "classic",
lastDailyReward: 0,
ownedThemes: []
});
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';
}
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 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);
var panel = self.attachAsset('inventoryPanel', {
anchorX: 0.5,
anchorY: 0.5
});
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 y = -400;
var birdTypes = [{
id: 'classic',
name: 'Classic Bird',
asset: 'bird'
}, {
id: 'diamondSword',
name: 'Diamond Sword Bird',
asset: 'diamondSwordBird'
}, {
id: 'golden',
name: 'Golden Bird',
asset: 'goldenBird'
}];
for (var i = 0; i < birdTypes.length; i++) {
var birdType = birdTypes[i];
if (storage.ownedBirds.indexOf(birdType.id) >= 0) {
var birdPreview = self.addChild(LK.getAsset(birdType.asset, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: 0,
y: y
}));
var birdNameText = new Text2(birdType.name, {
size: 40,
fill: '#FFFFFF'
});
birdNameText.anchor.set(0.5, 0.5);
birdNameText.x = 0;
birdNameText.y = y + 80;
self.addChild(birdNameText);
var selectButton = self.addChild(LK.getAsset('selectButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: y + 150
}));
var selectText = new Text2(storage.selectedBird === birdType.id ? 'SELECTED' : 'SELECT', {
size: 30,
fill: '#FFFFFF'
});
selectText.anchor.set(0.5, 0.5);
selectButton.addChild(selectText);
(function (birdId, button, text) {
button.down = function () {
storage.selectedBird = birdId;
text.setText('SELECTED');
// 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);
y += 300;
}
}
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 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
});
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);
// Diamond Sword Bird
var diamondSwordBirdPreview = self.addChild(LK.getAsset('diamondSwordBird', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2,
x: 0,
y: -300
}));
var diamondSwordText = new Text2('Diamond Sword Bird\n100 Diamonds', {
size: 40,
fill: '#FFFFFF'
});
diamondSwordText.anchor.set(0.5, 0.5);
diamondSwordText.x = 0;
diamondSwordText.y = -200;
self.addChild(diamondSwordText);
var diamondSwordButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: -100
}));
var diamondSwordButtonText = new Text2(storage.ownedBirds.indexOf('diamondSword') >= 0 ? 'OWNED' : 'BUY', {
size: 30,
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);
}
};
// Golden Bird
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: 40,
fill: '#FFFFFF'
});
goldenText.anchor.set(0.5, 0.5);
goldenText.x = 0;
goldenText.y = 300;
self.addChild(goldenText);
var goldenButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 400
}));
var goldenButtonText = new Text2(storage.ownedBirds.indexOf('golden') >= 0 ? 'OWNED' : 'BUY', {
size: 30,
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);
}
};
// THEMES Category
var themeTitleText = new Text2('THEMES', {
size: 60,
fill: '#FFD700'
});
themeTitleText.anchor.set(0.5, 0.5);
themeTitleText.x = 0;
themeTitleText.y = 550;
self.addChild(themeTitleText);
// Night Theme Preview (placeholder shape)
var nightThemePreview = self.addChild(LK.getAsset('shopPanel', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.2,
scaleY: 0.2,
x: 0,
y: 650
}));
var nightThemeText = new Text2('Night Theme\n800 Diamonds', {
size: 40,
fill: '#FFFFFF'
});
nightThemeText.anchor.set(0.5, 0.5);
nightThemeText.x = 0;
nightThemeText.y = 720;
self.addChild(nightThemeText);
var nightThemeButton = self.addChild(LK.getAsset('buyButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
y: 780
}));
var nightThemeButtonText = new Text2(storage.ownedThemes && storage.ownedThemes.indexOf('night') >= 0 ? 'OWNED' : 'BUY', {
size: 30,
fill: '#FFFFFF'
});
nightThemeButtonText.anchor.set(0.5, 0.5);
nightThemeButton.addChild(nightThemeButtonText);
nightThemeButton.down = function () {
if (!storage.ownedThemes) storage.ownedThemes = [];
if (storage.ownedThemes.indexOf('night') < 0 && storage.diamonds >= 800) {
storage.diamonds -= 800;
storage.ownedThemes.push('night');
nightThemeButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
}
};
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
****/
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
// 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 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);
}
};
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);
}
};
// 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);
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') {
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
@@ -4,9 +4,10 @@
var storage = LK.import("@upit/storage.v1", {
diamonds: 0,
ownedBirds: ["classic"],
selectedBird: "classic",
- lastDailyReward: 0
+ lastDailyReward: 0,
+ ownedThemes: []
});
var tween = LK.import("@upit/tween.v1");
/****
@@ -393,8 +394,55 @@
goldenButtonText.setText('OWNED');
diamondText.setText('Diamonds: ' + storage.diamonds);
}
};
+ // THEMES Category
+ var themeTitleText = new Text2('THEMES', {
+ size: 60,
+ fill: '#FFD700'
+ });
+ themeTitleText.anchor.set(0.5, 0.5);
+ themeTitleText.x = 0;
+ themeTitleText.y = 550;
+ self.addChild(themeTitleText);
+ // Night Theme Preview (placeholder shape)
+ var nightThemePreview = self.addChild(LK.getAsset('shopPanel', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.2,
+ scaleY: 0.2,
+ x: 0,
+ y: 650
+ }));
+ var nightThemeText = new Text2('Night Theme\n800 Diamonds', {
+ size: 40,
+ fill: '#FFFFFF'
+ });
+ nightThemeText.anchor.set(0.5, 0.5);
+ nightThemeText.x = 0;
+ nightThemeText.y = 720;
+ self.addChild(nightThemeText);
+ var nightThemeButton = self.addChild(LK.getAsset('buyButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 0,
+ y: 780
+ }));
+ var nightThemeButtonText = new Text2(storage.ownedThemes && storage.ownedThemes.indexOf('night') >= 0 ? 'OWNED' : 'BUY', {
+ size: 30,
+ fill: '#FFFFFF'
+ });
+ nightThemeButtonText.anchor.set(0.5, 0.5);
+ nightThemeButton.addChild(nightThemeButtonText);
+ nightThemeButton.down = function () {
+ if (!storage.ownedThemes) storage.ownedThemes = [];
+ if (storage.ownedThemes.indexOf('night') < 0 && storage.diamonds >= 800) {
+ storage.diamonds -= 800;
+ storage.ownedThemes.push('night');
+ nightThemeButtonText.setText('OWNED');
+ diamondText.setText('Diamonds: ' + storage.diamonds);
+ }
+ };
var closeButton = self.addChild(LK.getAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
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