User prompt
Seems trustworthy olan customerların para kazanma ifi var ama para kaybetme elsesi yok bazen paramız gitmiyor.
Code edit (1 edits merged)
Please save this source code
User prompt
volume değişikliği sadece menuMusicte çalışıyor bu değişiklik cashRegister sesinde, warning sesinde ve gameplayMusic sesinde de çalışsın. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyun başlamadan bir ses ayarı yaptığımızda oyun başlayınca da bu ses ayarını koru ve update et. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
upgrade textlerini paramız yetmeyince kırmızı yazıyor ama önce paramız çokken sonra azaldığında kırmızı yazmıyor yani update etmiyor onu düzeltebilir misin
Code edit (4 edits merged)
Please save this source code
User prompt
Customerlardan seems trustworthy olanlara regular verince para kazanak enhanced verince ise %60 oranla para kazanalım.
User prompt
-Customerlardan might report illegal activity! olanlara regular verince para kazanalım.Enhanced verince ise %50 şansla para kazananalım. -Customerlardan seems trustworthy olanlara regular ya da enhanced versek de para kazanalım. -Suspicious olan customerlara enhanced verince para kazanalım regular verince para kaybedelim
User prompt
Endofdaymenüsündeki upgrade textleri paramız yettiğinde normal renkte yazsın ama paramız yetmediğinde kırmızı renkte yazsın. Bir de suspicious customerlara regular ilaç verince paramız gitsin. Aynı regular ilaç isteyen customerlara enhanced ilaç verince paramızın gittiği gibi.
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'stroke')' in or related to this line: 'moneyText.style.stroke = 0x000000;' Line Number: 262
User prompt
eklentiler sadece 1 kere seçilebilir olsun. 2. gün seçtiğimiz eklenti sonraki günler gelemesin ya da 4. gün seçtiğimiz eklenti sonraki günler gelmesin gibi. Bir de customerlara ilaç satınca gelen ya da giden para daha belirgin şekilde yazsın zor okunuyor - ya da + paralar
User prompt
Ayarlar menüsü açılınca ayarlar menüsünün arkasında kalan tuşlar basılamasın. Bir de ses ayarını arttırıp azaltınca oyunda olup olabilecek bütün sesleri arttırıp azaltsın.Bütün müzikler ve bütün soundlar gibi
Code edit (2 edits merged)
Please save this source code
User prompt
Ayarlar düğmesine basınca ayarlar ekranı açılsın. -Ayarlar ekranının içinde sesi ayarlıyabileceğimiz volume slider bulunsun. -Ayarlar ekranının içinde sağ üstte geri tuşu olsun ve bu tuş geri start screene döndürsün.
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
start screeni bu saydığım şeyler olmucak şekilde güncelle: -money texti -rolls hakları texti -timer texti -capacity texti -day texti -Click a customer to see details texti -counter -regular pill -enhanced pill
User prompt
oyun başlangıç ekranını arka tarafı gözükmücek şekilde yap.Sadece pharmacy tycoon ve altındaki manage your pharmacy yazısı yazsın bir de zorluk ayarlar ve başlatma butonları kalsın.
User prompt
ayarlar, zorluk seçimi ve başlat butonlarının olduğu bir start screen yapabilir misin farklı assetli.
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'visible')' in or related to this line: 'moneyText.visible = false;' Line Number: 968
User prompt
start screen farklı bir ekran olsun oyun içi içerikleri gözükmesin
User prompt
oyunun başına başlangıç ekranı tasarla. Orda sadece kolay orta zor seviye seçme ve start game tuşu olsun . Bir de ayarlar tuşu da olsun
User prompt
roll hakları başlangıçta zor modda 2 orta modda 4 kolay modda 6 olsun
User prompt
vip customerların açıklamasında regular customer yerine vip customer yazsın. ilaç açıklması da bir alt satırda yazsın.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
volume: 0.3
});
/****
* Classes
****/
var ConfirmationDialog = Container.expand(function (message, cost, onConfirm) {
var self = Container.call(this);
// Dialog background - covers entire screen to block clicks
var dialogBg = self.attachAsset('pharmacyBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 1.0,
scaleY: 1.0
});
dialogBg.tint = 0x000000;
dialogBg.alpha = 1.0;
// Add click handler to background to prevent clicks from going through
dialogBg.down = function (x, y, obj) {
// Do nothing - this blocks clicks from reaching other elements
};
// Confirmation message
var messageContent = cost > 0 ? 'Yükseltmek ister misin?\n' + message + '\nMaliyet: $' + cost : message + '\n\nBu eklentiyi seçmek istiyor musun?';
var messageText = new Text2(messageContent, {
size: 60,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
messageText.anchor.set(0.5, 0.5);
messageText.x = 1024;
messageText.y = 1200;
self.addChild(messageText);
// Yes button
var yesButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 824,
y: 1500,
scaleX: 1.5,
scaleY: 1.5
}));
yesButton.tint = 0x228b22;
var yesText = new Text2('EVET', {
size: 50,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
yesText.anchor.set(0.5, 0.5);
yesText.x = 824;
yesText.y = 1500;
self.addChild(yesText);
// No button
var noButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1224,
y: 1500,
scaleX: 1.5,
scaleY: 1.5
}));
noButton.tint = 0xcc0000;
var noText = new Text2('HAYIR', {
size: 50,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
noText.anchor.set(0.5, 0.5);
noText.x = 1224;
noText.y = 1500;
self.addChild(noText);
// Event handlers
yesButton.down = function (x, y, obj) {
onConfirm();
self.destroy();
};
noButton.down = function (x, y, obj) {
self.destroy();
};
return self;
});
var Customer = Container.expand(function () {
var self = Container.call(this);
// Determine customer type based on active addons
self.isDouble = doubleCustomersActive && Math.random() < 0.2;
self.isVip = vipCustomersActive && Math.random() < 0.15;
self.isSuspicious = !self.isDouble && !self.isVip && Math.random() < 0.3;
self.willReport = self.isSuspicious ? false : Math.random() < 0.4;
self.served = false;
self.timeOnScreen = 0;
self.needsSecondDose = self.isDouble;
// Define customer types
var customerTypes = ['customer', 'customerElderly', 'customerYoung', 'customerBusiness'];
var selectedType;
if (self.isDouble) {
selectedType = 'doubleCustomer';
} else if (self.isVip) {
selectedType = 'vipCustomer';
} else if (self.isSuspicious) {
selectedType = 'suspiciousCustomer';
} else {
selectedType = customerTypes[Math.floor(Math.random() * customerTypes.length)];
}
self.customerType = selectedType;
var customerGraphics = self.attachAsset(selectedType, {
anchorX: 0.5,
anchorY: 1.0,
scaleX: 1.5,
scaleY: 1.5
});
self.regularPayment = 10 + Math.floor(Math.random() * 11);
self.enhancedPayment = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
self.update = function () {
self.timeOnScreen++;
var patienceTime = riskBalanceActive ? 420 : 600; // 30% less patience if risk balance active
if (self.timeOnScreen > patienceTime && !self.served) {
self.leaveAngry();
}
};
self.serveRegular = function () {
if (self.served) {
return;
}
self.served = true;
var earnedAmount = self.regularPayment + regularUpgradeBonus;
// "Might report illegal activity!" (willReport true): regular = earn, enhanced = 50% earn
// "Seems trustworthy" (willReport false, not suspicious): always earn
// Suspicious: regular = lose, enhanced = earn
if (self.isSuspicious) {
// Suspicious: regular = lose, enhanced = earn
var penaltyAmount = 20 * day;
money -= penaltyAmount;
LK.getSound('warning').play();
penalties++;
self.showMoneyLost(penaltyAmount);
earnedAmount = 0; // No money earned
} else if (self.willReport) {
// "Might report illegal activity!" - regular = earn
// EnhancedFocus disables regular income
if (enhancedFocusActive) {
earnedAmount = 0;
} else {
// Regular enhanced chance - 15% chance to get enhanced price
if (regularEnhancedChance && Math.random() < 0.15) {
earnedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
}
// VIP customer doubles money
if (self.isVip) {
earnedAmount *= 2;
}
// Double money days
if (doubleMoneyDays > 0) {
earnedAmount *= 2;
}
// Risk balance - 1.5x multiplier
if (riskBalanceActive) {
earnedAmount = Math.floor(earnedAmount * 1.5);
}
}
money += earnedAmount;
if (earnedAmount > 0) {
LK.getSound('cashRegister').play();
self.showMoneyEarned(earnedAmount);
}
} else {
// "Seems trustworthy" (not suspicious, willReport false): always earn
if (enhancedFocusActive) {
earnedAmount = 0;
} else {
// Regular enhanced chance - 15% chance to get enhanced price
if (regularEnhancedChance && Math.random() < 0.15) {
earnedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
}
// VIP customer doubles money
if (self.isVip) {
earnedAmount *= 2;
}
// Double money days
if (doubleMoneyDays > 0) {
earnedAmount *= 2;
}
// Risk balance - 1.5x multiplier
if (riskBalanceActive) {
earnedAmount = Math.floor(earnedAmount * 1.5);
}
}
money += earnedAmount;
if (earnedAmount > 0) {
LK.getSound('cashRegister').play();
self.showMoneyEarned(earnedAmount);
}
}
// Handle double customers
if (self.needsSecondDose) {
self.needsSecondDose = false;
self.served = false; // Allow second serving
return; // Don't leave yet
}
self.leave();
};
self.serveEnhanced = function () {
if (self.served) {
return;
}
self.served = true;
// "Might report illegal activity!" (willReport true): enhanced = 50% earn, 50% penalty
// "Seems trustworthy" (willReport false, not suspicious): always earn
// Suspicious: enhanced = earn, regular = lose
if (self.isSuspicious) {
// Suspicious: enhanced = earn
var enhancedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
// Enhanced double chance - 15% chance for 2x money
if (enhancedDoubleChance && Math.random() < 0.15) {
enhancedAmount *= 2;
}
// Enhanced focus addon - 2x money from enhanced
if (enhancedFocusActive) {
enhancedAmount *= 2;
}
// VIP customer doubles money
if (self.isVip) {
enhancedAmount *= 2;
}
// Double money days
if (doubleMoneyDays > 0) {
enhancedAmount *= 2;
}
// Risk balance - 1.5x multiplier
if (riskBalanceActive) {
enhancedAmount = Math.floor(enhancedAmount * 1.5);
}
money += enhancedAmount;
LK.getSound('cashRegister').play();
self.showMoneyEarned(enhancedAmount);
} else if (self.willReport) {
// "Might report illegal activity!" - enhanced = 50% earn, 50% penalty
if (Math.random() < 0.3) {
// Earn money
var enhancedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
if (enhancedDoubleChance && Math.random() < 0.15) {
enhancedAmount *= 2;
}
if (enhancedFocusActive) {
enhancedAmount *= 2;
}
if (self.isVip) {
enhancedAmount *= 2;
}
if (doubleMoneyDays > 0) {
enhancedAmount *= 2;
}
if (riskBalanceActive) {
enhancedAmount = Math.floor(enhancedAmount * 1.5);
}
money += enhancedAmount;
LK.getSound('cashRegister').play();
self.showMoneyEarned(enhancedAmount);
} else {
// Penalty
var penaltyAmount = 20 * day;
money -= penaltyAmount;
LK.getSound('warning').play();
penalties++;
self.showMoneyLost(penaltyAmount);
}
} else {
// "Seems trustworthy" (not suspicious, willReport false): 60% chance to earn
if (Math.random() < 0.7) {
// Earn money
var enhancedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
if (enhancedDoubleChance && Math.random() < 0.15) {
enhancedAmount *= 2;
}
if (enhancedFocusActive) {
enhancedAmount *= 2;
}
if (self.isVip) {
enhancedAmount *= 2;
}
if (doubleMoneyDays > 0) {
enhancedAmount *= 2;
}
if (riskBalanceActive) {
enhancedAmount = Math.floor(enhancedAmount * 1.5);
}
money += enhancedAmount;
LK.getSound('cashRegister').play();
self.showMoneyEarned(enhancedAmount);
}
}
// Handle double customers
if (self.needsSecondDose) {
self.needsSecondDose = false;
self.served = false; // Allow second serving
return; // Don't leave yet
}
self.leave();
};
self.leave = function () {
tween(self, {
alpha: 0,
y: self.y - 100
}, {
duration: 500,
onFinish: function onFinish() {
self.destroy();
}
});
};
self.leaveAngry = function () {
var penaltyAmount = 10 + Math.floor(Math.random() * 11) + 15 * (day - 1);
money -= penaltyAmount;
self.served = true; // Mark as served so it gets removed from customers array
self.showMoneyLost(penaltyAmount);
self.leave();
};
self.showMoneyEarned = function (amount) {
var moneyText = new Text2('+$' + amount, {
size: 120,
fill: 0x00FF00,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0.5, 0.5);
moneyText.x = self.x;
moneyText.y = self.y - 200;
// Start with larger scale for emphasis
moneyText.scaleX = 1.5;
moneyText.scaleY = 1.5;
game.addChild(moneyText);
tween(moneyText, {
y: moneyText.y - 150,
alpha: 0,
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 2000,
onFinish: function onFinish() {
moneyText.destroy();
}
});
};
self.showMoneyLost = function (amount) {
var moneyText = new Text2('-$' + amount, {
size: 120,
fill: 0xFF0000,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0.5, 0.5);
moneyText.x = self.x;
moneyText.y = self.y - 200;
// Start with larger scale for emphasis
moneyText.scaleX = 1.5;
moneyText.scaleY = 1.5;
game.addChild(moneyText);
tween(moneyText, {
y: moneyText.y - 150,
alpha: 0,
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 2000,
onFinish: function onFinish() {
moneyText.destroy();
}
});
};
return self;
});
var EndOfDayMenu = Container.expand(function () {
var self = Container.call(this);
// Start menu music immediately when menu is created with stored volume
var savedVolume = storage.volume || 0.3;
LK.playMusic('menuMusic');
// Menu background
var menuBg = self.attachAsset('pharmacyBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 0.8,
scaleY: 0.6
});
menuBg.tint = 0x000000;
menuBg.alpha = 0.8;
// Menu title - Day Complete at top, moved higher
var menuTitle = new Text2('Day ' + day + ' Complete!', {
size: 160,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
menuTitle.anchor.set(0.5, 0.5);
menuTitle.x = 1024;
menuTitle.y = 650;
self.addChild(menuTitle);
// Daily earnings text - below title
var earningsText = new Text2('Total Money: $' + money, {
size: 70,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
earningsText.anchor.set(0.5, 0.5);
earningsText.x = 1024;
earningsText.y = 880;
self.addChild(earningsText);
// Capacity upgrade button - center top with more spacing (only show if capacity < 5)
var capacityButton = null;
var capacityText = null;
if (pharmacyCapacity < 5) {
capacityButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2050,
scaleX: 2.5,
scaleY: 2.5
}));
var capacityCost = 150 + (pharmacyCapacity - 1) * 50;
var capacityTextColor = money >= capacityCost ? 0xFFFFFF : 0xFF0000;
capacityText = new Text2('Upgrade\nCapacity\n$' + capacityCost, {
size: 55,
fill: capacityTextColor,
font: 'Comic Sans MS'
});
capacityText.anchor.set(0.5, 0.5);
capacityText.x = 1024;
capacityText.y = 2050;
self.addChild(capacityText);
}
// Regular payment upgrade button - center middle with proper spacing
var regularUpgradeButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1450,
scaleX: 2.5,
scaleY: 2.5
}));
var regularUpgradeCost = 200 + (regularUpgradeLevel - 1) * 50;
var regularTextColor = money >= regularUpgradeCost ? 0xFFFFFF : 0xFF0000;
var regularUpgradeText = new Text2('Upgrade\nRegular\n$' + regularUpgradeCost, {
size: 55,
fill: regularTextColor,
font: 'Comic Sans MS'
});
regularUpgradeText.anchor.set(0.5, 0.5);
regularUpgradeText.x = 1024;
regularUpgradeText.y = 1450;
self.addChild(regularUpgradeText);
// Enhanced multiplier upgrade button - center bottom with proper spacing
var enhancedUpgradeButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1750,
scaleX: 2.5,
scaleY: 2.5
}));
var enhancedUpgradeCost = 300 + (enhancedUpgradeLevel - 1) * 50;
var enhancedTextColor = money >= enhancedUpgradeCost ? 0xFFFFFF : 0xFF0000;
var enhancedUpgradeText = new Text2('Upgrade\nEnhanced\n$' + enhancedUpgradeCost, {
size: 55,
fill: enhancedTextColor,
font: 'Comic Sans MS'
});
enhancedUpgradeText.anchor.set(0.5, 0.5);
enhancedUpgradeText.x = 1024;
enhancedUpgradeText.y = 1750;
self.addChild(enhancedUpgradeText);
// Customer speed upgrade button
var customerSpeedButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1150,
scaleX: 2.5,
scaleY: 2.5
}));
var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
var customerSpeedTextColor = money >= customerSpeedCost ? 0xFFFFFF : 0xFF0000;
var customerSpeedText = new Text2('Upgrade\nCustomer Speed\n$' + customerSpeedCost, {
size: 55,
fill: customerSpeedTextColor,
font: 'Comic Sans MS'
});
customerSpeedText.anchor.set(0.5, 0.5);
customerSpeedText.x = 1024;
customerSpeedText.y = 1150;
self.addChild(customerSpeedText);
// Next day button - bottom right, moved lower
var nextDayButton = self.addChild(LK.getAsset('nextDayButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1600,
y: 2190,
scaleX: 1.5,
scaleY: 1.5
}));
var nextDayText = new Text2('Next Day', {
size: 50,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
nextDayText.anchor.set(0.5, 0.5);
nextDayText.x = 1600;
nextDayText.y = 2190;
self.addChild(nextDayText);
// Function to update upgrade text colors based on current money
function updateUpgradeTextColors() {
if (capacityText && pharmacyCapacity < 5) {
var capacityCost = 150 + (pharmacyCapacity - 1) * 50;
var capacityTextColor = money >= capacityCost ? 0xFFFFFF : 0xFF0000;
capacityText.tint = capacityTextColor;
}
var regularUpgradeCost = 200 + (regularUpgradeLevel - 1) * 50;
var regularTextColor = money >= regularUpgradeCost ? 0xFFFFFF : 0xFF0000;
regularUpgradeText.tint = regularTextColor;
var enhancedUpgradeCost = 300 + (enhancedUpgradeLevel - 1) * 50;
var enhancedTextColor = money >= enhancedUpgradeCost ? 0xFFFFFF : 0xFF0000;
enhancedUpgradeText.tint = enhancedTextColor;
var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
var customerSpeedTextColor = money >= customerSpeedCost ? 0xFFFFFF : 0xFF0000;
customerSpeedText.tint = customerSpeedTextColor;
}
// Initial color update
updateUpgradeTextColors();
// Event handlers
if (capacityButton) {
capacityButton.down = function (x, y, obj) {
var capacityCost = 150 + (pharmacyCapacity - 1) * 50;
if (money >= capacityCost && pharmacyCapacity < 5) {
var confirmDialog = game.addChild(new ConfirmationDialog('Kapasite Yükseltmesi', capacityCost, function () {
money -= capacityCost;
pharmacyCapacity++;
earningsText.setText('Total Money: $' + money);
moneyText.setText('Money: $' + money);
capacityText2.setText('Capacity: ' + pharmacyCapacity);
if (pharmacyCapacity >= 5) {
capacityButton.destroy();
capacityText.destroy();
} else {
capacityText.setText('Upgrade\nCapacity\n$' + (150 + (pharmacyCapacity - 1) * 50));
}
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
updateUpgradeTextColors();
}));
}
};
}
regularUpgradeButton.down = function (x, y, obj) {
var regularUpgradeCost = 200 + (regularUpgradeLevel - 1) * 50;
if (money >= regularUpgradeCost) {
var confirmDialog = game.addChild(new ConfirmationDialog('Normal İlaç Yükseltmesi', regularUpgradeCost, function () {
money -= regularUpgradeCost;
regularUpgradeLevel++;
regularUpgradeBonus += 5;
earningsText.setText('Total Money: $' + money);
moneyText.setText('Money: $' + money);
regularUpgradeText.setText('Upgrade\nRegular\n$' + (200 + (regularUpgradeLevel - 1) * 50));
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
updateUpgradeTextColors();
}));
}
};
enhancedUpgradeButton.down = function (x, y, obj) {
var enhancedUpgradeCost = 300 + (enhancedUpgradeLevel - 1) * 50;
if (money >= enhancedUpgradeCost) {
var confirmDialog = game.addChild(new ConfirmationDialog('Gelişmiş İlaç Yükseltmesi', enhancedUpgradeCost, function () {
money -= enhancedUpgradeCost;
enhancedUpgradeLevel++;
enhancedMultiplier += 0.2;
earningsText.setText('Total Money: $' + money);
moneyText.setText('Money: $' + money);
enhancedUpgradeText.setText('Upgrade\nEnhanced\n$' + (300 + (enhancedUpgradeLevel - 1) * 50));
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
updateUpgradeTextColors();
}));
}
};
customerSpeedButton.down = function (x, y, obj) {
var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
if (money >= customerSpeedCost) {
var confirmDialog = game.addChild(new ConfirmationDialog('Müşteri Hızı Yükseltmesi', customerSpeedCost, function () {
money -= customerSpeedCost;
customerSpeedUpgrade++;
earningsText.setText('Total Money: $' + money);
moneyText.setText('Money: $' + money);
customerSpeedText.setText('Upgrade\nCustomer Speed\n$' + (250 + customerSpeedUpgrade * 75));
updateUpgradeTextColors();
}));
}
};
nextDayButton.down = function (x, y, obj) {
nextDay();
self.destroy();
endOfDayMenu = null;
gameRunning = true;
var savedVolume = storage.volume || 0.3;
if (savedVolume > 0) {
LK.playMusic('gameplayMusic', {
fade: {
start: 0,
end: savedVolume,
duration: 100
}
});
} else {
LK.playMusic('gameplayMusic');
}
};
return self;
});
var GameStartScreen = Container.expand(function () {
var self = Container.call(this);
// Start screen background
var startBg = self.attachAsset('startBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
// Game title
var titleText = new Text2('Pharmacy Tycoon', {
size: 250,
fill: 0x0a1df0,
font: 'Comic Sans MS'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 350;
self.addChild(titleText);
// Subtitle
var subtitleText = new Text2('Manage your pharmacy and serve customers!', {
size: 90,
fill: 0x000000,
font: 'Comic Sans MS'
});
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 600;
self.addChild(subtitleText);
// Settings button
var settingsButton = self.addChild(LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1600,
scaleX: 1.5,
scaleY: 1.5
}));
settingsButton.tint = 0x808080;
var settingsText = new Text2('AYARLAR', {
size: 50,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
settingsText.anchor.set(0.5, 0.5);
settingsText.x = 1024;
settingsText.y = 1600;
self.addChild(settingsText);
// Difficulty selection button
self.selectedDifficulty = 'normal';
var difficultyButton = self.addChild(LK.getAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1350,
scaleX: 1.5,
scaleY: 1.5
}));
difficultyButton.tint = 0x4682b4;
var difficultyText = new Text2('ZORLUK: ORTA', {
size: 50,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
difficultyText.anchor.set(0.5, 0.5);
difficultyText.x = 1024;
difficultyText.y = 1350;
self.addChild(difficultyText);
// Start button
var startButton = self.addChild(LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1100,
scaleX: 1.8,
scaleY: 1.8
}));
var startButtonText = new Text2('BAŞLAT', {
size: 60,
fill: 0x000000,
font: 'Comic Sans MS'
});
startButtonText.anchor.set(0.5, 0.5);
startButtonText.x = 1024;
startButtonText.y = 1100;
self.addChild(startButtonText);
// Update difficulty display
function updateDifficultyDisplay() {
var difficultyNames = {
'easy': 'KOLAY',
'normal': 'ORTA',
'hard': 'ZOR'
};
difficultyText.setText('ZORLUK: ' + difficultyNames[self.selectedDifficulty]);
var colors = {
'easy': 0x90EE90,
'normal': 0x4682b4,
'hard': 0xf74a59
};
difficultyButton.tint = colors[self.selectedDifficulty];
}
// Settings button event - show settings screen
settingsButton.down = function (x, y, obj) {
var settingsScreen = game.addChild(new SettingsScreen(self));
};
// Difficulty button event - cycle through difficulties
difficultyButton.down = function (x, y, obj) {
var difficulties = ['easy', 'normal', 'hard'];
var currentIndex = difficulties.indexOf(self.selectedDifficulty);
self.selectedDifficulty = difficulties[(currentIndex + 1) % difficulties.length];
updateDifficultyDisplay();
};
// Start button event
startButton.down = function (x, y, obj) {
gameDifficulty = self.selectedDifficulty;
startGame();
self.destroy();
};
return self;
});
var MedicationButton = Container.expand(function (type) {
var self = Container.call(this);
self.type = type;
var buttonGraphics = self.attachAsset(type === 'regular' ? 'regularPill' : 'greenSubstance', {
anchorX: 0.5,
anchorY: 0.5
});
self.down = function (x, y, obj) {
if (selectedCustomer && !selectedCustomer.served) {
if (self.type === 'regular') {
selectedCustomer.serveRegular();
} else {
selectedCustomer.serveEnhanced();
}
selectedCustomer = null;
updateCustomerInfo();
}
};
return self;
});
var SettingsScreen = Container.expand(function (parentScreen) {
var self = Container.call(this);
// Settings background - covers entire screen and blocks clicks
var settingsBg = self.attachAsset('startBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 1.0,
scaleY: 1.0
});
settingsBg.tint = 0x000000;
settingsBg.alpha = 0.9;
// Add click handler to background to prevent clicks from going through
settingsBg.down = function (x, y, obj) {
// Do nothing - this blocks clicks from reaching other elements
};
// Settings title
var titleText = new Text2('AYARLAR', {
size: 200,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 400;
self.addChild(titleText);
// Volume label
var volumeLabel = new Text2('SES SEVİYESİ', {
size: 100,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
volumeLabel.anchor.set(0.5, 0.5);
volumeLabel.x = 1024;
volumeLabel.y = 800;
self.addChild(volumeLabel);
// Current volume (load from storage or default 0.3 based on music initialization)
var currentVolume = storage.volume || 0.3;
// Volume slider background
var sliderBg = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1000,
scaleX: 3.7,
scaleY: 1.5
}));
sliderBg.tint = 0x444444;
// Volume slider handle
var sliderHandle = self.addChild(LK.getAsset('rollButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024 - 400 + currentVolume * 800,
// Position based on volume (0-1)
y: 1000,
scaleX: 1.5,
scaleY: 1.5
}));
sliderHandle.tint = 0xFFD700;
// Volume percentage text
var volumeText = new Text2(Math.round(currentVolume * 100) + '%', {
size: 80,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
volumeText.anchor.set(0.5, 0.5);
volumeText.x = 1024;
volumeText.y = 1150;
self.addChild(volumeText);
// Back button (top right)
var backButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1800,
y: 200,
scaleX: 2.0,
scaleY: 1.5
}));
backButton.tint = 0xFF4444;
var backText = new Text2('GERİ', {
size: 60,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
backText.anchor.set(0.5, 0.5);
backText.x = 1800;
backText.y = 200;
self.addChild(backText);
// Update volume function
function updateVolume(newVolume) {
currentVolume = Math.max(0, Math.min(1, newVolume));
sliderHandle.x = 1024 - 400 + currentVolume * 800;
volumeText.setText(Math.round(currentVolume * 100) + '%');
// Save volume to storage
storage.volume = currentVolume;
// Apply volume to all sounds
LK.getSound('cashRegister').volume = currentVolume;
LK.getSound('warning').volume = currentVolume;
// Apply volume to music
LK.stopMusic();
if (currentVolume > 0) {
LK.playMusic('menuMusic', {
fade: {
start: 0,
end: currentVolume,
duration: 100
}
});
}
}
// Slider interaction
var isDragging = false;
sliderBg.down = function (x, y, obj) {
isDragging = true;
var localX = x - (1024 - 400); // Convert to slider coordinate
var newVolume = Math.max(0, Math.min(1, localX / 800));
updateVolume(newVolume);
};
sliderHandle.down = function (x, y, obj) {
isDragging = true;
};
game.move = function (x, y, obj) {
if (isDragging) {
var localX = x - (1024 - 400); // Convert to slider coordinate
var newVolume = Math.max(0, Math.min(1, localX / 800));
updateVolume(newVolume);
}
};
game.up = function (x, y, obj) {
isDragging = false;
};
// Back button event
backButton.down = function (x, y, obj) {
// Restore original game move/up handlers
game.move = null;
game.up = null;
self.destroy();
};
return self;
});
var SpecialUpgradeMenu = Container.expand(function () {
var self = Container.call(this);
// Available addons with descriptions and effects
var availableAddons = [{
name: 'Para Şansı',
description: 'Random -500 ila +500 para',
apply: function apply() {
var randomMoney = Math.floor(Math.random() * 1001) - 500;
money += randomMoney;
}
}, {
name: 'Roll Hediyesi',
description: '3 roll hakkı kazanın',
apply: function apply() {
rollRights += 3;
}
}, {
name: 'Süper Yükseltme',
description: 'Tüm upgradeler +1 (kapasite hariç)',
apply: function apply() {
regularUpgradeLevel++;
regularUpgradeBonus += 5;
enhancedUpgradeLevel++;
enhancedMultiplier += 0.2;
customerSpeedUpgrade++;
}
}, {
name: 'Zaman Uzatma',
description: 'Sonraki günler 10sn uzar',
apply: function apply() {
dayLength += 600; // 10 seconds = 600 ticks
}
}, {
name: 'Çift İlaç Müşteri',
description: 'Çift ilaç alan müşteriler gelir',
apply: function apply() {
doubleCustomersActive = true;
}
}, {
name: 'VIP Müşteriler',
description: 'VIP müşteriler 2x para kazandırır',
apply: function apply() {
vipCustomersActive = true;
}
}, {
name: 'Regular Bonusu',
description: 'Regular ilaçlar %15 şansla enhanced fiyatı',
apply: function apply() {
regularEnhancedChance = true;
}
}, {
name: 'Enhanced Bonusu',
description: 'Enhanced ilaçlar %15 şansla 2x gelir',
apply: function apply() {
enhancedDoubleChance = true;
}
}, {
name: 'Müşteri Bonusu',
description: 'Gün sonunda müşteri başına $20',
apply: function apply() {
customerEndBonus = true;
}
}, {
name: 'Çift Kazanç',
description: 'Sonraki 2 gün 2x para',
apply: function apply() {
doubleMoneyDays = 2;
}
}, {
name: 'Risk Dengeleme',
description: '1.5x gelir ama %30 az sabır',
apply: function apply() {
riskBalanceActive = true;
}
}, {
name: 'Enhanced Odak',
description: 'Enhanced 2x kazanç ama regular 0',
apply: function apply() {
enhancedFocusActive = true;
}
}];
// Function to get random addon excluding already selected ones
function getRandomAddon(excludeAddons) {
var availableChoices = availableAddons.filter(function (addon) {
return excludeAddons.indexOf(addon) === -1 && selectedAddonNames.indexOf(addon.name) === -1;
});
if (availableChoices.length === 0) {
availableChoices = availableAddons.slice(); // fallback to all addons
}
return availableChoices[Math.floor(Math.random() * availableChoices.length)];
}
// Menu background - covers entire screen
var menuBg = self.attachAsset('pharmacyBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 1.0,
scaleY: 1.0
});
menuBg.tint = 0x000000;
menuBg.alpha = 0.95;
// Menu title
var titleText = new Text2('Özel Eklenti Seçimi!', {
size: 120,
fill: 0xFFD700,
font: 'Comic Sans MS'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 300;
self.addChild(titleText);
// Money display
var moneyDisplayText = new Text2('Money: $' + money, {
size: 80,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
moneyDisplayText.anchor.set(0.5, 0.5);
moneyDisplayText.x = 1024;
moneyDisplayText.y = 400;
self.addChild(moneyDisplayText);
// Roll rights display
var rollDisplayText = new Text2('Rolls: ' + rollRights, {
size: 80,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
rollDisplayText.anchor.set(0.5, 0.5);
rollDisplayText.x = 1024;
rollDisplayText.y = 480;
self.addChild(rollDisplayText);
// Select 3 random addons excluding already selected ones
var selectedAddons = [];
var availableForSelection = availableAddons.filter(function (addon) {
return selectedAddonNames.indexOf(addon.name) === -1;
});
// If we don't have enough unselected addons, include some selected ones
if (availableForSelection.length < 3) {
availableForSelection = availableAddons.slice();
}
var shuffledAddons = availableForSelection.slice();
// Simple shuffle
for (var i = shuffledAddons.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = shuffledAddons[i];
shuffledAddons[i] = shuffledAddons[j];
shuffledAddons[j] = temp;
}
selectedAddons = shuffledAddons.slice(0, 3);
// Create addon buttons
var addonButtons = [];
var addonTexts = [];
var rollButtons = [];
for (var i = 0; i < 3; i++) {
var addon = selectedAddons[i];
var yPos = 1000 + i * 600;
// Addon button
var addonButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 900,
y: yPos,
scaleX: 6.0,
scaleY: 5.0
}));
addonButton.tint = 0x9932CC;
// Addon text
var addonText = new Text2(addon.name + '\n' + addon.description, {
size: 65,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
addonText.anchor.set(0.5, 0.5);
addonText.x = 900;
addonText.y = yPos;
self.addChild(addonText);
// Roll button
var rollButton = self.addChild(LK.getAsset('rollButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1850,
y: yPos,
scaleX: 2.5,
scaleY: 2.5
}));
// Roll button text
var rollButtonText = new Text2('Roll', {
size: 65,
fill: 0x000000,
font: 'Comic Sans MS'
});
rollButtonText.anchor.set(0.5, 0.5);
rollButtonText.x = 1850;
rollButtonText.y = yPos;
self.addChild(rollButtonText);
// Store references
addonButtons.push(addonButton);
addonTexts.push(addonText);
rollButtons.push(rollButton);
// Add click handler - store addon reference directly on button
addonButton.selectedAddon = addon;
addonButton.down = function (x, y, obj) {
var selectedAddon = this.selectedAddon;
var confirmDialog = game.addChild(new ConfirmationDialog(selectedAddon.name + '\n' + selectedAddon.description, 0, function () {
selectedAddon.apply();
// Track this addon as selected
if (selectedAddonNames.indexOf(selectedAddon.name) === -1) {
selectedAddonNames.push(selectedAddon.name);
}
updateUI();
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
capacityText2.setText('Capacity: ' + pharmacyCapacity);
self.destroy();
// Show end of day menu after addon selection
if (!endOfDayMenu) {
endOfDayMenu = game.addChild(new EndOfDayMenu());
}
}));
};
// Roll button click handler
rollButton.addonIndex = i;
rollButton.down = function (x, y, obj) {
if (rollRights > 0) {
rollRights--;
rollRightsText.setText('Rolls: ' + rollRights);
rollDisplayText.setText('Rolls: ' + rollRights);
var index = this.addonIndex;
// Get new random addon excluding currently selected ones
var newAddon = getRandomAddon(selectedAddons);
selectedAddons[index] = newAddon;
addonButtons[index].selectedAddon = newAddon;
addonTexts[index].setText(newAddon.name + '\n' + newAddon.description);
}
};
}
return self;
});
var StartScreen = Container.expand(function () {
var self = Container.call(this);
// Start screen background
var startBg = self.attachAsset('startBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
// Game title
var titleText = new Text2('Pharmacy Tycoon', {
size: 250,
fill: 0x0a1df0,
font: 'Comic Sans MS'
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
self.addChild(titleText);
// Subtitle
var subtitleText = new Text2('Manage your pharmacy and serve customers!', {
size: 95,
fill: 0x000000,
font: 'Comic Sans MS'
});
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 1050;
self.addChild(subtitleText);
// Difficulty selection
self.selectedDifficulty = 'normal'; // Default difficulty
// Easy difficulty button
var easyButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 512,
y: 1300,
scaleX: 1.5,
scaleY: 1.5
}));
easyButton.tint = 0x90EE90;
var easyText = new Text2('KOLAY', {
size: 45,
fill: 0x000000,
font: 'Comic Sans MS'
});
easyText.anchor.set(0.5, 0.5);
easyText.x = 512;
easyText.y = 1300;
self.addChild(easyText);
// Normal difficulty button
var normalButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1300,
scaleX: 1.5,
scaleY: 1.5
}));
normalButton.tint = 0x12aae6;
var normalText = new Text2('ORTA', {
size: 45,
fill: 0x000000,
font: 'Comic Sans MS'
});
normalText.anchor.set(0.5, 0.5);
normalText.x = 1024;
normalText.y = 1300;
self.addChild(normalText);
// Hard difficulty button
var hardButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1536,
y: 1300,
scaleX: 1.5,
scaleY: 1.5
}));
hardButton.tint = 0xf74a59;
var hardText = new Text2('ZOR', {
size: 45,
fill: 0x000000,
font: 'Comic Sans MS'
});
hardText.anchor.set(0.5, 0.5);
hardText.x = 1536;
hardText.y = 1300;
self.addChild(hardText);
// Update button appearance based on selection
function updateDifficultyButtons() {
easyButton.alpha = self.selectedDifficulty === 'easy' ? 1.0 : 0.6;
normalButton.alpha = self.selectedDifficulty === 'normal' ? 1.0 : 0.6;
hardButton.alpha = self.selectedDifficulty === 'hard' ? 1.0 : 0.6;
}
// Initial update
updateDifficultyButtons();
// Difficulty button events
easyButton.down = function (x, y, obj) {
self.selectedDifficulty = 'easy';
updateDifficultyButtons();
};
normalButton.down = function (x, y, obj) {
self.selectedDifficulty = 'normal';
updateDifficultyButtons();
};
hardButton.down = function (x, y, obj) {
self.selectedDifficulty = 'hard';
updateDifficultyButtons();
};
// Start button
var startButton = self.addChild(LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1500
}));
var startButtonText = new Text2('START GAME', {
size: 50,
fill: 0x000000,
font: 'Comic Sans MS'
});
startButtonText.anchor.set(0.5, 0.5);
startButtonText.x = 1024;
startButtonText.y = 1500;
self.addChild(startButtonText);
// Start button event
startButton.down = function (x, y, obj) {
gameDifficulty = self.selectedDifficulty;
startGame();
self.destroy();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xf0f8ff
});
/****
* Game Code
****/
// Game variables
var money = 0;
var day = 1;
var pharmacyCapacity = 1;
var penalties = 0;
var customers = [];
var selectedCustomer = null;
var dayTimer = 0;
var dayLength = 1800; // 30 seconds per day
var customersServedToday = 0;
var customersNeededToday = Math.floor(Math.random() * 7) + 2;
var endOfDayMenu = null;
var gameRunning = false;
var gameStarted = false;
var regularUpgradeBonus = 0;
var enhancedMultiplier = 1.5;
var customerSpeedUpgrade = 0;
var gameDifficulty = 'normal'; // Default difficulty
var regularUpgradeLevel = 1;
var enhancedUpgradeLevel = 1;
var rollRights = 3;
// New addon variables
var doubleCustomersActive = false;
var vipCustomersActive = false;
var regularEnhancedChance = false;
var enhancedDoubleChance = false;
var customerEndBonus = false;
var doubleMoneyDays = 0;
var riskBalanceActive = false;
var enhancedFocusActive = false;
// Track selected addons to prevent re-selection
var selectedAddonNames = [];
// Add pharmacy background
var pharmacyBg = game.addChild(LK.getAsset('pharmacyBackground', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
}));
// Show start screen
var startScreen = game.addChild(new GameStartScreen());
// UI Elements - hidden initially for start screen
var moneyText = new Text2('Money: $' + money, {
size: 80,
fill: 0x000000,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0, 0);
moneyText.x = 50;
moneyText.y = 50;
moneyText.visible = false;
game.addChild(moneyText);
var rollRightsText = new Text2('Rolls: ' + rollRights, {
size: 90,
fill: 0x000000,
font: 'Comic Sans MS'
});
rollRightsText.anchor.set(0, 0);
rollRightsText.x = 50;
rollRightsText.y = 130;
rollRightsText.visible = false;
game.addChild(rollRightsText);
var dayText = new Text2('Day ' + day, {
size: 80,
fill: 0x000000,
font: 'Comic Sans MS'
});
dayText.anchor.set(1, 0);
dayText.x = 1998;
dayText.y = 50;
dayText.visible = false;
game.addChild(dayText);
var timerText = new Text2('Time: ' + Math.ceil((dayLength - dayTimer) / 60), {
size: 80,
fill: 0x000000,
font: 'Comic Sans MS'
});
timerText.anchor.set(0.5, 0);
timerText.x = 1024;
timerText.y = 50;
timerText.visible = false;
game.addChild(timerText);
var modeText = new Text2('', {
size: 80,
fill: 0x000000,
font: 'Comic Sans MS'
});
modeText.anchor.set(0.5, 0);
modeText.x = 1750; // Positioned between money (50) and timer (1024)
modeText.y = 175;
modeText.visible = false;
game.addChild(modeText);
var capacityText2 = new Text2('Capacity: ' + pharmacyCapacity, {
size: 80,
fill: 0x000000,
font: 'Comic Sans MS'
});
capacityText2.anchor.set(0.5, 0);
capacityText2.x = 1511; // Positioned between timer (1024) and day (1998)
capacityText2.y = 50;
capacityText2.visible = false;
game.addChild(capacityText2);
var customerInfoText = new Text2('Click a customer to see details', {
size: 100,
fill: 0x000000,
font: 'Comic Sans MS'
});
customerInfoText.anchor.set(0.5, 0);
customerInfoText.x = 1024;
customerInfoText.y = 300;
customerInfoText.visible = false;
game.addChild(customerInfoText);
// Pharmacy counter - hidden initially
var counter = game.addChild(LK.getAsset('counter', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2500
}));
counter.visible = false;
// Medication buttons - hidden initially
var regularButton = game.addChild(new MedicationButton('regular'));
regularButton.x = 1024;
regularButton.y = 1900;
regularButton.scaleX = 2;
regularButton.scaleY = 2;
regularButton.visible = false;
var enhancedButton = game.addChild(new MedicationButton('enhanced'));
enhancedButton.x = 1024;
enhancedButton.y = 2275;
enhancedButton.scaleX = 2;
enhancedButton.scaleY = 2;
enhancedButton.visible = false;
// Button labels - hidden initially
var regularLabel = new Text2('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')', {
size: 70,
fill: 0xf70505,
font: 'Comic Sans MS'
});
regularLabel.anchor.set(0.5, 0);
regularLabel.x = 1024;
regularLabel.y = 2017;
regularLabel.visible = false;
game.addChild(regularLabel);
var enhancedLabel = new Text2('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)', {
size: 70,
fill: 0x228B22,
font: 'Comic Sans MS'
});
enhancedLabel.anchor.set(0.5, 0);
enhancedLabel.x = 1024;
enhancedLabel.y = 2392;
enhancedLabel.visible = false;
game.addChild(enhancedLabel);
// Define 5 fixed customer spawn positions
var customerSpawnPositions = [{
x: 204,
y: 1760
},
// Position 1
{
x: 614,
y: 1760
},
// Position 2
{
x: 1024,
y: 1760
},
// Position 3 (center)
{
x: 1434,
y: 1760
},
// Position 4
{
x: 1844,
y: 1760
} // Position 5
];
// Functions
function spawnCustomer() {
// Limit to maximum customers based on pharmacy capacity
if (customers.length >= pharmacyCapacity) {
return;
}
// Find available spawn positions
var availablePositions = [];
for (var posIndex = 0; posIndex < customerSpawnPositions.length; posIndex++) {
var position = customerSpawnPositions[posIndex];
var occupied = false;
// Check if this position is already occupied
for (var j = 0; j < customers.length; j++) {
var distance = Math.sqrt(Math.pow(customers[j].x - position.x, 2) + Math.pow(customers[j].y - position.y, 2));
if (distance < 200) {
// Reduced distance threshold since positions are fixed
occupied = true;
break;
}
}
if (!occupied) {
availablePositions.push(position);
}
}
// If no positions available, return
if (availablePositions.length === 0) {
return;
}
// Select random available position
var selectedPosition = availablePositions[Math.floor(Math.random() * availablePositions.length)];
var customer = new Customer();
customer.x = selectedPosition.x;
customer.y = selectedPosition.y;
customer.down = function (x, y, obj) {
selectedCustomer = customer;
updateCustomerInfo();
};
customers.push(customer);
game.addChild(customer);
}
function updateCustomerInfo() {
if (selectedCustomer && !selectedCustomer.served) {
var info = '';
if (selectedCustomer.isSuspicious) {
info = 'Suspicious customer\n - might accept enhanced medication';
} else {
var typeDescriptions = {
'customer': 'Regular adult customer',
'customerElderly': 'Elderly customer with chronic conditions',
'customerYoung': 'Young customer with minor ailments',
'customerBusiness': 'Business person, always in a hurry',
'vipCustomer': 'VIP customer',
'doubleCustomer': 'Double pill customer'
};
var baseDesc = typeDescriptions[selectedCustomer.customerType] || 'Regular customer';
info = baseDesc + '\n - ' + (selectedCustomer.willReport ? 'might report illegal activity!' : 'seems trustworthy');
}
customerInfoText.setText(info);
} else {
customerInfoText.setText('Click a customer to see details');
}
}
function updateUI() {
moneyText.setText('Money: $' + money);
dayText.setText('Day ' + day);
var remainingTime = Math.max(0, Math.ceil((dayLength - dayTimer) / 60));
timerText.setText('Time: ' + remainingTime);
capacityText2.setText('Capacity: ' + pharmacyCapacity);
rollRightsText.setText('Rolls: ' + rollRights);
}
function nextDay() {
// Customer end bonus - $20 per customer served
if (customerEndBonus) {
var bonusAmount = customersServedToday * 20;
money += bonusAmount;
}
// Decrease double money days
if (doubleMoneyDays > 0) {
doubleMoneyDays--;
}
day++;
dayTimer = 0;
customersServedToday = 0;
customersNeededToday = Math.floor(Math.random() * 7) + 2;
penalties = 0;
selectedCustomer = null;
// Clear remaining customers
for (var i = customers.length - 1; i >= 0; i--) {
customers[i].destroy();
}
customers = [];
// Save progress
storage.money = money;
storage.day = day;
storage.pharmacyCapacity = pharmacyCapacity;
updateCustomerInfo();
}
// Functions
function startGame() {
gameStarted = true;
gameRunning = true;
// Show all game UI elements
moneyText.visible = true;
rollRightsText.visible = true;
dayText.visible = true;
timerText.visible = true;
modeText.visible = true;
capacityText2.visible = true;
customerInfoText.visible = true;
counter.visible = true;
regularButton.visible = true;
enhancedButton.visible = true;
regularLabel.visible = true;
enhancedLabel.visible = true;
// Initialize upgrade levels
regularUpgradeLevel = 1;
enhancedUpgradeLevel = 1;
rollRights = 3;
// Set difficulty-based starting values
if (gameDifficulty === 'easy') {
money = 500;
regularUpgradeBonus = 20; // Regular 30-40 instead of 10-20
enhancedMultiplier = 2.1; // Enhanced 3x instead of 1.5x
rollRights = 6; // Easy mode gets 6 roll rights
} else if (gameDifficulty === 'normal') {
money = 250;
regularUpgradeBonus = 10; // Regular 20-30 instead of 10-20
enhancedMultiplier = 1.7; // Enhanced 2x instead of 1.5x
rollRights = 4; // Normal mode gets 4 roll rights
} else {
// hard mode
money = 100; // Keep current starting money
regularUpgradeBonus = 0; // Keep current values (10-20)
enhancedMultiplier = 1.5; // Keep current multiplier
rollRights = 2; // Hard mode gets 2 roll rights
}
// Update mode text based on selected difficulty
var modeDisplayText = gameDifficulty === 'easy' ? 'Kolay' : gameDifficulty === 'hard' ? 'Zor' : 'Orta';
modeText.setText('Mode: ' + modeDisplayText);
// Update UI elements with new values
updateUI();
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
// Apply stored volume settings
var savedVolume = storage.volume;
LK.getSound('cashRegister').volume = savedVolume;
LK.getSound('warning').volume = savedVolume;
if (savedVolume > 0) {
LK.playMusic('gameplayMusic', {
fade: {
start: 0,
end: savedVolume,
duration: 100
}
});
} else {
LK.playMusic('gameplayMusic');
}
}
// Event handlers
game.update = function () {
if (!gameStarted || !gameRunning) {
return;
}
dayTimer++;
// Check if day time is over AND no customers remain
if (dayTimer >= dayLength && customers.length === 0) {
dayTimer = dayLength; // Prevent timer from going below 0
gameRunning = false;
// Check if this is a special upgrade day (2, 4, 6, 8)
if ((day === 2 || day === 4 || day === 6 || day === 8) && !endOfDayMenu) {
var specialUpgradeMenu = game.addChild(new SpecialUpgradeMenu());
} else if (!endOfDayMenu) {
endOfDayMenu = game.addChild(new EndOfDayMenu());
}
return;
}
// Clamp dayTimer to prevent negative display
if (dayTimer > dayLength) {
dayTimer = dayLength;
}
// Spawn customers randomly - faster with upgrades (only if time hasn't run out)
var baseSpawnRate = 120;
var adjustedSpawnRate = Math.max(30, baseSpawnRate - customerSpeedUpgrade * 10);
var spawnProbability = Math.min(0.95, 0.7 + customerSpeedUpgrade * 0.05);
if (dayTimer < dayLength && LK.ticks % adjustedSpawnRate === 0 && Math.random() < spawnProbability) {
spawnCustomer();
}
// Remove served customers
for (var i = customers.length - 1; i >= 0; i--) {
var customer = customers[i];
if (customer.served && customer.alpha <= 0) {
customers.splice(i, 1);
customersServedToday++;
}
}
// Check win condition
if (money >= 10000) {
LK.showYouWin();
}
// Check lose condition
if (money < 0) {
LK.showGameOver();
}
updateUI();
}; ===================================================================
--- original.js
+++ change.js
@@ -1605,9 +1605,9 @@
updateUI();
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
// Apply stored volume settings
- var savedVolume = storage.volume || 0.3;
+ var savedVolume = storage.volume;
LK.getSound('cashRegister').volume = savedVolume;
LK.getSound('warning').volume = savedVolume;
if (savedVolume > 0) {
LK.playMusic('gameplayMusic', {
normal bir customer çiz önden bakılmış bir şekilde. In-Game asset. 2d. High contrast. No shadows
2d iş adamı bir customer çiz önden bakılmış şekilde. In-Game asset. 2d. High contrast. No shadows
bana keko gözüken bir customer çiz 2d olsun önden gözüksün. In-Game asset. 2d. High contrast. No shadows
daire şeklinde olsun görsel izometrik açıdan bakalım ilaç resmi olsun normal içilen ilaç. In-Game asset. 2d. High contrast. No shadows
arka planı mavi değil yeşil olsun
dikdörtgen şeklinde bir counter yapacaksın ama sadece counter insan falan olmucak ve biz bu countera üstten bakıyoruz 2d olsun. Üstünde bir kaç ilaç resmi olabilir ama ortasında olmasın sağında ve solunda olsun. In-Game asset. 2d. High contrast. No shadows
vip bir customer çiz sarı ceketli olsun ve sarı saçlı olsun önden bakılmış bir şekilde. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
çok hasta bir kadın customer çiz önden bakılmış bir şekilde yazısız olsun. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows