User prompt
2.sayfanın sağ üst köşesine soru işareti butonu ekle
User prompt
hediye kutusu butonu yalnızca bir kez satın alınabilir. fiyatı 10000 dolar . hediye kutusu butonu aktif olduğunda her 10 dakikada 1000 dolar verir. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
hediye kutusu butonunu biraz daha sola kaydır
User prompt
hediye kutusu butonunu biraz daha sola taşı
User prompt
hediye kutusu butonunu biraz daha sola taşı
User prompt
2.sayfada 'TIKLA KAZAN' yazısının sol tarafına hediye kutusu butonu ekle
User prompt
jet butonu yalnız bir kez satın alınabilir . fiyatı 10000 dolar . Jet butonu aktif olduğunda her 5 dakikada 200 dolar para verir ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
uçak butonu yalnızca bir kez satın alınabilir . Fiyatı 5000 dolar . Uçak butonu aktif olduğunda her tıklamada 50 dolar kazandırır ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
balon butonu yalnızca bir defa satın alınabilir. Fiyatı 1000 dolar . Balon butonu özelliği aktif olduğunda her tıklamada 35 dolar kazandırır ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
uçak butonunun üstün jet butonu ekle
User prompt
para kazanma butonunu biraz yukarı taşı
User prompt
para kazanma butonunu biraz sağa taşı
User prompt
balon butonunun üstüne uçak butonu ekle
User prompt
TIKLA KAZAN yazısını biraz yukarı taşı
User prompt
para miktarını 'TIKLA KAZAN' yazısının altına taşı
User prompt
para miktarı yazısını beyaz renk yap
User prompt
para miktarını yeşil çerçeve içine al
User prompt
balon butonunu en alta taşı
User prompt
2.sayfanın altın balon butonu ekle
User prompt
2.sayfada yer alan 'sayfa 3' yazısını değiştir. yeni yazı 'ileri'
User prompt
sayfa 3 yazısını değiştir yeni yazı 'ileri'
User prompt
2.sayfanın sağ alt kısmına 3.sayfayı açan buton ekle
User prompt
dolar simgesini biraz daha sağa taşı
User prompt
dolar simgesini biraz sağa taşı
User prompt
kazanmak için tıkla butonuna para simgesi ekle
/****
* Plugins
****/
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var GameScreen = Container.expand(function () {
var self = Container.call(this);
// Initialize balloon purchase status
self.balloonPurchased = storage.balloonPurchased || false;
// Initialize airplane purchase status
self.airplanePurchased = storage.airplanePurchased || false;
// Header text
var headerText = new Text2('TIKLA KAZAN', {
size: 150,
fill: 0x006400
});
headerText.anchor.set(0.5, 0);
headerText.x = 2048 / 2;
headerText.y = 100;
self.addChild(headerText);
// Money display with green border
var moneyBorder = self.attachAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
width: 300,
height: 120,
x: 2048 / 2,
y: 350
});
// Change border color to green
moneyBorder.tint = 0x00FF00;
var moneyText = new Text2('$0', {
size: 100,
fill: 0xFFFFFF
});
moneyText.anchor.set(0.5, 0.5);
moneyText.x = 2048 / 2;
moneyText.y = 350;
self.addChild(moneyText);
// Center earn button
var earnButton = new MenuButton('KAZANMAK İÇİN TIKLA', 400, 100);
earnButton.x = 2048 / 2 + 100; // Move to the right
earnButton.y = 1200; // Move higher up on screen
// Add dollar sign to earn button
var dollarIcon = earnButton.attachAsset('dollarSign', {
anchorX: 0.5,
anchorY: 0.5,
x: -50,
y: 0
});
// Add dollar sign text
var dollarText = new Text2('$', {
size: 50,
fill: 0x000000
});
dollarText.anchor.set(0.5, 0.5);
dollarText.x = -50;
dollarText.y = 0;
earnButton.addChild(dollarText);
earnButton.onPress = function () {
var earnAmount = 25;
if (self.balloonPurchased) earnAmount = 35;
if (self.airplanePurchased) earnAmount = 50;
self.currentMoney += earnAmount;
self.updateMoney();
LK.effects.flashObject(moneyText, 0x00FF00, 300);
};
self.addChild(earnButton);
// Back button
var backButton = new MenuButton('BACK', 200, 80);
backButton.x = 150;
backButton.y = 2632;
backButton.onPress = function () {
showMainMenu();
};
self.addChild(backButton);
// Third page button in bottom right
var thirdPageButton = new MenuButton('İLERİ', 200, 80);
thirdPageButton.x = 1898; // Right side with margin for border
thirdPageButton.y = 2632; // Bottom with margin for border
thirdPageButton.onPress = function () {
showThirdPage();
};
self.addChild(thirdPageButton);
// Jet button above airplane
var jetButton = new MenuButton('🚀', 150, 150);
jetButton.x = 2048 / 2;
jetButton.y = 2100; // Position above airplane button
jetButton.onPress = function () {
// Jet functionality can be added here
LK.effects.flashObject(jetButton, 0xFF6347, 300);
};
self.addChild(jetButton);
// Airplane button above balloon
var airplaneButtonText = self.airplanePurchased ? '✈️' : '✈️ : $5000';
var airplaneButton = new MenuButton(airplaneButtonText, 200, 150);
airplaneButton.x = 2048 / 2;
airplaneButton.y = 2300; // Position above balloon button
airplaneButton.onPress = function () {
if (!self.airplanePurchased) {
// Check if player has enough money to buy airplane
if (self.currentMoney >= 5000) {
self.currentMoney -= 5000;
self.airplanePurchased = true;
storage.airplanePurchased = true;
self.updateMoney();
// Update button text to remove price
airplaneButton.removeChild(airplaneButton.children[1]); // Remove old text
var newButtonText = new Text2('✈️', {
size: 60,
fill: 0x000000
});
newButtonText.anchor.set(0.5, 0.5);
airplaneButton.addChild(newButtonText);
LK.effects.flashObject(airplaneButton, 0x00FF00, 300);
} else {
// Not enough money - flash red
LK.effects.flashObject(airplaneButton, 0xFF0000, 300);
}
} else {
// Airplane already purchased - flash blue
LK.effects.flashObject(airplaneButton, 0x87CEEB, 300);
}
};
self.addChild(airplaneButton);
// Golden balloon button
var balloonButtonText = self.balloonPurchased ? '🎈' : '🎈 $1000';
var balloonButton = new MenuButton(balloonButtonText, 200, 150);
balloonButton.x = 2048 / 2;
balloonButton.y = 2500; // Move to bottom of screen
balloonButton.onPress = function () {
if (!self.balloonPurchased) {
// Check if player has enough money to buy balloon
if (self.currentMoney >= 1000) {
self.currentMoney -= 1000;
self.balloonPurchased = true;
storage.balloonPurchased = true;
self.updateMoney();
// Update button text to remove price
balloonButton.removeChild(balloonButton.children[1]); // Remove old text
var newButtonText = new Text2('🎈', {
size: 60,
fill: 0x000000
});
newButtonText.anchor.set(0.5, 0.5);
balloonButton.addChild(newButtonText);
LK.effects.flashObject(balloonButton, 0x00FF00, 300);
} else {
// Not enough money - flash red
LK.effects.flashObject(balloonButton, 0xFF0000, 300);
}
} else {
// Balloon already purchased - flash gold
LK.effects.flashObject(balloonButton, 0xFFD700, 300);
}
};
self.addChild(balloonButton);
self.currentMoney = storage.money || 0;
self.updateMoney = function () {
moneyText.setText('$' + self.currentMoney);
storage.money = self.currentMoney;
};
self.updateMoney();
return self;
});
var MainMenu = Container.expand(function () {
var self = Container.call(this);
// Game title
var titleText = new Text2('MONEY MAN', {
size: 200,
fill: 0x006400
});
titleText.anchor.set(0.5, 0);
titleText.x = 2048 / 2;
titleText.y = 300;
self.addChild(titleText);
// Start button
var startButton = new MenuButton('BAŞLA');
startButton.x = 2048 / 2;
startButton.y = 1000;
startButton.onPress = function () {
showGameScreen();
};
self.addChild(startButton);
// Continue button
var continueButton = new MenuButton('KAYITLI OYUNA DEVAM ET');
continueButton.x = 2048 / 2;
continueButton.y = 1200;
continueButton.onPress = function () {
showGameScreen();
};
self.addChild(continueButton);
// Delete button
var deleteButton = new MenuButton('Oyunu Sıfırla');
deleteButton.x = 2048 / 2;
deleteButton.y = 1400;
deleteButton.onPress = function () {
storage.money = 0;
LK.effects.flashScreen(0xFF0000, 500);
};
self.addChild(deleteButton);
return self;
});
var MenuButton = Container.expand(function (text, width, height) {
var self = Container.call(this);
width = width || 600;
height = height || 120;
var buttonBackground = self.attachAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
width: width,
height: height
});
var buttonText = new Text2(text, {
size: 60,
fill: 0x000000
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.down = function (x, y, obj) {
LK.getSound('click').play();
buttonBackground.alpha = 0.8;
};
self.up = function (x, y, obj) {
buttonBackground.alpha = 1.0;
if (self.onPress) {
self.onPress();
}
};
return self;
});
var ThirdPage = Container.expand(function () {
var self = Container.call(this);
// Header text
var headerText = new Text2('İLERİ', {
size: 150,
fill: 0x006400
});
headerText.anchor.set(0.5, 0);
headerText.x = 2048 / 2;
headerText.y = 300;
self.addChild(headerText);
// Back button to game screen
var backButton = new MenuButton('GERİ', 200, 80);
backButton.x = 150;
backButton.y = 2632;
backButton.onPress = function () {
showGameScreen();
};
self.addChild(backButton);
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xD3D3D3
});
/****
* Game Code
****/
// Background
var background = game.attachAsset('background', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0
});
// Border elements
var topBorder = game.attachAsset('border', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0
});
var bottomBorder = game.attachAsset('border', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 2682
});
var leftBorder = game.attachAsset('border', {
anchorX: 0,
anchorY: 0,
width: 50,
height: 2732,
x: 0,
y: 0
});
var rightBorder = game.attachAsset('border', {
anchorX: 0,
anchorY: 0,
width: 50,
height: 2732,
x: 1998,
y: 0
});
// Screen management
var currentScreen = null;
var mainMenu = null;
var gameScreen = null;
var thirdPage = null;
function showMainMenu() {
if (currentScreen) {
game.removeChild(currentScreen);
currentScreen.destroy();
}
mainMenu = new MainMenu();
currentScreen = mainMenu;
game.addChild(currentScreen);
}
function showGameScreen() {
if (currentScreen) {
game.removeChild(currentScreen);
currentScreen.destroy();
}
gameScreen = new GameScreen();
currentScreen = gameScreen;
game.addChild(currentScreen);
}
function showThirdPage() {
if (currentScreen) {
game.removeChild(currentScreen);
currentScreen.destroy();
}
thirdPage = new ThirdPage();
currentScreen = thirdPage;
game.addChild(currentScreen);
}
// Start with main menu
showMainMenu();
game.update = function () {
// Game logic updates handled by individual screens
}; ===================================================================
--- original.js
+++ change.js
@@ -9,8 +9,10 @@
var GameScreen = Container.expand(function () {
var self = Container.call(this);
// Initialize balloon purchase status
self.balloonPurchased = storage.balloonPurchased || false;
+ // Initialize airplane purchase status
+ self.airplanePurchased = storage.airplanePurchased || false;
// Header text
var headerText = new Text2('TIKLA KAZAN', {
size: 150,
fill: 0x006400
@@ -58,9 +60,11 @@
dollarText.x = -50;
dollarText.y = 0;
earnButton.addChild(dollarText);
earnButton.onPress = function () {
- var earnAmount = self.balloonPurchased ? 35 : 25;
+ var earnAmount = 25;
+ if (self.balloonPurchased) earnAmount = 35;
+ if (self.airplanePurchased) earnAmount = 50;
self.currentMoney += earnAmount;
self.updateMoney();
LK.effects.flashObject(moneyText, 0x00FF00, 300);
};
@@ -90,14 +94,37 @@
LK.effects.flashObject(jetButton, 0xFF6347, 300);
};
self.addChild(jetButton);
// Airplane button above balloon
- var airplaneButton = new MenuButton('✈️', 150, 150);
+ var airplaneButtonText = self.airplanePurchased ? '✈️' : '✈️ : $5000';
+ var airplaneButton = new MenuButton(airplaneButtonText, 200, 150);
airplaneButton.x = 2048 / 2;
airplaneButton.y = 2300; // Position above balloon button
airplaneButton.onPress = function () {
- // Airplane functionality can be added here
- LK.effects.flashObject(airplaneButton, 0x87CEEB, 300);
+ if (!self.airplanePurchased) {
+ // Check if player has enough money to buy airplane
+ if (self.currentMoney >= 5000) {
+ self.currentMoney -= 5000;
+ self.airplanePurchased = true;
+ storage.airplanePurchased = true;
+ self.updateMoney();
+ // Update button text to remove price
+ airplaneButton.removeChild(airplaneButton.children[1]); // Remove old text
+ var newButtonText = new Text2('✈️', {
+ size: 60,
+ fill: 0x000000
+ });
+ newButtonText.anchor.set(0.5, 0.5);
+ airplaneButton.addChild(newButtonText);
+ LK.effects.flashObject(airplaneButton, 0x00FF00, 300);
+ } else {
+ // Not enough money - flash red
+ LK.effects.flashObject(airplaneButton, 0xFF0000, 300);
+ }
+ } else {
+ // Airplane already purchased - flash blue
+ LK.effects.flashObject(airplaneButton, 0x87CEEB, 300);
+ }
};
self.addChild(airplaneButton);
// Golden balloon button
var balloonButtonText = self.balloonPurchased ? '🎈' : '🎈 $1000';