User prompt
Oyunu asla durdurma oyunu sadece süre bittiğinde ve aynı zamanda customer kalmayınca bitir.
User prompt
oyunu asla durdurma. Oyunu sadece süre bittiğinde ve customer kalmadığında durdur yoksa başka zaman durdurma. oyun durunca da endofdaymenüsü gelsin
User prompt
süre bittiği gibi oyun durmasın hemen. hem süre bittiğinde hem de hiç customer kalmamışsa dursun.Durduğunda endofdaymenüsü gelsin ekrana
Code edit (1 edits merged)
Please save this source code
User prompt
time bittiğinde customer var mı yok mu kontrol et eğer yoksa endofdaymenüsü gelsin. Oyunda şu anda süre bitmesine ve customer olmamasına rağmen oyun sonraki güne geçmiyor
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: gamerunning is not defined' in or related to this line: 'if (!gamerunning && customers.length === 0 && !endOfDayMenu) {' Line Number: 711
Code edit (1 edits merged)
Please save this source code
User prompt
Customerler erkanda random yerlerde çıksın capacity sayısı ile ilgili olmasın çıkması. capacity sayısı ekranda bulunabilcek maksimum csutomer sayısına eşit olsun.Yani capacity 1 olunca ekranda sadece tek seferde 1 kişi görebilcez ama yine random yerlerde çıkıcak, 5 olursa ekranda tek seferde 5 kişi görebilcez.
Code edit (6 edits merged)
Please save this source code
User prompt
Capacity maximum 5 olsun eğer oyundaki capacity sayısı 5 olursa upgrade capacity düğmesi kalksın ve diğer gün sonlarında da upragde capacity olmasın. Bir de müşterileri azıcık daha sola çek capacity 5 olunca en sağdaki müşteri ekranın dışına çıkıyor.
User prompt
zaman 1 olduğunda sürekli bir şekilde ekranda müşteri olup olmadığını kontrol et eğer müşteri varsa gün bitimi ekranı gelmicek eğer müşteri yoksa gün bitim ekranı gelcek.
User prompt
Süre bittiğinde customer gelmeyi bıraksın. Süre bittiğinde eğer customer hala varsa endofdaymenüsü gelmesin. Endofdaymenüsü hem süre bittiğinde hem de aynı anda customer olmadığında gelsin.
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
confarmation dialogun backgroundu opak siyah olsun arkası gözükmesin.
User prompt
day complete ekranında para harcanınca sol üstteki oyun içi para kısmı da eş zamanlı güncellensin. Bir de herhangi bir upgrade butonuna tıkladığımızda bize bir ekran çıksın ve ekranda yükseltmek ister misin yazsın altında da biri evet biri de hayır olacak şekilde 2 buton olsun evete basınca upgrade gerçekleşsin ve o ekran kaybolsun hayıra basınca upgrade gerçekleşmesin ve o ekran koybolsun.
User prompt
upgrade butonuna basılınca ve upgrade gerçekleştirilince upgrade parasını güncelle ve güncel uprade parası gözüksün.
Code edit (1 edits merged)
Please save this source code
User prompt
oyundaki üsttteki time sayacı ile sağ üstteki day sayacının tam ortasına sizeı 60 olacak şekilde pharmacycapacityi göstercek bir tane sayaç koysun sayacın ismi de Capacity: olsun
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Müşterileri birbirine çarmıyacak ve ekrandan çıkmayacak şekilde büyüt. Regular ilaç butonunun y koordinatını değiştirme ama x koordinatını ortala ve butonu 2 kat büyüt.Enhanced butonunu da 2 kat büyütüp regular butonunun altına koy. Bir de bir tane daha upgrade butonu oluştur. ismi upgrade customer speed olsun. Bu butonun işlevi de customer gelme hızını arttırsın her upgrade butonuna basınca ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (3 edits merged)
Please save this source code
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Customer = Container.expand(function () {
var self = Container.call(this);
self.isSuspicious = Math.random() < 0.3;
self.willReport = self.isSuspicious ? false : Math.random() < 0.4;
self.served = false;
self.timeOnScreen = 0;
// Define customer types
var customerTypes = ['customer', 'customerElderly', 'customerYoung', 'customerBusiness'];
var selectedType = self.isSuspicious ? 'suspiciousCustomer' : 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++;
if (self.timeOnScreen > 600 && !self.served) {
self.leaveAngry();
}
};
self.serveRegular = function () {
if (self.served) {
return;
}
self.served = true;
var earnedAmount = self.regularPayment + regularUpgradeBonus;
money += earnedAmount;
LK.getSound('cashRegister').play();
self.showMoneyEarned(earnedAmount);
self.leave();
};
self.serveEnhanced = function () {
if (self.served) {
return;
}
self.served = true;
if (self.willReport) {
var penaltyAmount = 50 * day;
money -= penaltyAmount;
LK.getSound('warning').play();
penalties++;
self.showMoneyLost(penaltyAmount);
} else {
var enhancedAmount = Math.floor((self.regularPayment + regularUpgradeBonus) * enhancedMultiplier);
money += enhancedAmount;
LK.getSound('cashRegister').play();
self.showMoneyEarned(enhancedAmount);
}
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) + 5 * (day - 1);
money -= penaltyAmount;
self.showMoneyLost(penaltyAmount);
self.leave();
};
self.showMoneyEarned = function (amount) {
var moneyText = new Text2('+$' + amount, {
size: 50,
fill: 0x00FF00,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0.5, 0.5);
moneyText.x = self.x;
moneyText.y = self.y - 150;
game.addChild(moneyText);
tween(moneyText, {
y: moneyText.y - 100,
alpha: 0
}, {
duration: 1500,
onFinish: function onFinish() {
moneyText.destroy();
}
});
};
self.showMoneyLost = function (amount) {
var moneyText = new Text2('-$' + amount, {
size: 50,
fill: 0xFF0000,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0.5, 0.5);
moneyText.x = self.x;
moneyText.y = self.y - 150;
game.addChild(moneyText);
tween(moneyText, {
y: moneyText.y - 100,
alpha: 0
}, {
duration: 1500,
onFinish: function onFinish() {
moneyText.destroy();
}
});
};
return self;
});
var EndOfDayMenu = Container.expand(function () {
var self = Container.call(this);
// 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
var capacityButton = self.addChild(LK.getAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1150,
scaleX: 2.5,
scaleY: 2.5
}));
var capacityCost = 150 + (pharmacyCapacity - 3) * 50;
var capacityText = new Text2('Upgrade\nCapacity\n$' + capacityCost, {
size: 55,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
capacityText.anchor.set(0.5, 0.5);
capacityText.x = 1024;
capacityText.y = 1150;
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 + regularUpgradeBonus / 5 * 50;
var regularUpgradeText = new Text2('Upgrade\nRegular\n$' + regularUpgradeCost, {
size: 55,
fill: 0xFFFFFF,
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 enhancedUpgradeCount = Math.round((enhancedMultiplier - 1.4) / 0.1);
var enhancedUpgradeCost = 300 + enhancedUpgradeCount * 50;
var enhancedUpgradeText = new Text2('Upgrade\nEnhanced\n$' + enhancedUpgradeCost, {
size: 55,
fill: 0xFFFFFF,
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: 2050,
scaleX: 2.5,
scaleY: 2.5
}));
var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
var customerSpeedText = new Text2('Upgrade\nCustomer Speed\n$' + customerSpeedCost, {
size: 55,
fill: 0xFFFFFF,
font: 'Comic Sans MS'
});
customerSpeedText.anchor.set(0.5, 0.5);
customerSpeedText.x = 1024;
customerSpeedText.y = 2050;
self.addChild(customerSpeedText);
// Next day button - bottom right, moved lower
var nextDayButton = self.addChild(LK.getAsset('nextDayButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1570,
y: 2350,
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 = 1570;
nextDayText.y = 2350;
self.addChild(nextDayText);
// Event handlers
capacityButton.down = function (x, y, obj) {
var capacityCost = 150 + (pharmacyCapacity - 3) * 50;
if (money >= capacityCost) {
money -= capacityCost;
pharmacyCapacity++;
earningsText.setText('Total Money: $' + money);
capacityText.setText('Upgrade\nCapacity\n$' + (150 + (pharmacyCapacity - 3) * 50));
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
}
};
regularUpgradeButton.down = function (x, y, obj) {
var regularUpgradeCost = 200 + regularUpgradeBonus / 5 * 50;
if (money >= regularUpgradeCost) {
money -= regularUpgradeCost;
regularUpgradeBonus += 5;
earningsText.setText('Total Money: $' + money);
regularUpgradeText.setText('Upgrade\nRegular\n$' + (200 + regularUpgradeBonus / 5 * 50));
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
}
};
enhancedUpgradeButton.down = function (x, y, obj) {
var enhancedUpgradeCount = Math.round((enhancedMultiplier - 1.4) / 0.1);
var enhancedUpgradeCost = 300 + enhancedUpgradeCount * 50;
if (money >= enhancedUpgradeCost) {
money -= enhancedUpgradeCost;
enhancedMultiplier += 0.1;
earningsText.setText('Total Money: $' + money);
var newEnhancedUpgradeCount = Math.round((enhancedMultiplier - 1.4) / 0.1);
enhancedUpgradeText.setText('Upgrade\nEnhanced\n$' + (300 + newEnhancedUpgradeCount * 50));
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
}
};
customerSpeedButton.down = function (x, y, obj) {
var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
if (money >= customerSpeedCost) {
money -= customerSpeedCost;
customerSpeedUpgrade++;
earningsText.setText('Total Money: $' + money);
customerSpeedText.setText('Upgrade\nCustomer Speed\n$' + (250 + customerSpeedUpgrade * 75));
}
};
nextDayButton.down = function (x, y, obj) {
nextDay();
self.destroy();
endOfDayMenu = null;
gameRunning = true;
};
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 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: 120,
fill: 0xFFFFFF,
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: 60,
fill: 0x000000,
font: 'Comic Sans MS'
});
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 950;
self.addChild(subtitleText);
// Start button
var startButton = self.addChild(LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1400
}));
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 = 1400;
self.addChild(startButtonText);
// Start button event
startButton.down = function (x, y, obj) {
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 = 3;
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.4;
var customerSpeedUpgrade = 0;
// 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 StartScreen());
// UI Elements
var moneyText = new Text2('Money: $' + money, {
size: 60,
fill: 0x000000,
font: 'Comic Sans MS'
});
moneyText.anchor.set(0, 0);
moneyText.x = 50;
moneyText.y = 50;
game.addChild(moneyText);
var dayText = new Text2('Day ' + day, {
size: 60,
fill: 0x000000,
font: 'Comic Sans MS'
});
dayText.anchor.set(1, 0);
dayText.x = 1998;
dayText.y = 50;
game.addChild(dayText);
var timerText = new Text2('Time: ' + Math.ceil((dayLength - dayTimer) / 60), {
size: 50,
fill: 0x000000,
font: 'Comic Sans MS'
});
timerText.anchor.set(0.5, 0);
timerText.x = 1024;
timerText.y = 50;
game.addChild(timerText);
var customerInfoText = new Text2('Click a customer to see details', {
size: 60,
fill: 0x000000,
font: 'Comic Sans MS'
});
customerInfoText.anchor.set(0.5, 0);
customerInfoText.x = 1024;
customerInfoText.y = 150;
game.addChild(customerInfoText);
// Pharmacy counter
var counter = game.addChild(LK.getAsset('counter', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2500
}));
// Medication buttons
var regularButton = game.addChild(new MedicationButton('regular'));
regularButton.x = 1024;
regularButton.y = 1900;
regularButton.scaleX = 2;
regularButton.scaleY = 2;
var enhancedButton = game.addChild(new MedicationButton('enhanced'));
enhancedButton.x = 1024;
enhancedButton.y = 2100;
enhancedButton.scaleX = 2;
enhancedButton.scaleY = 2;
// Button labels
var regularLabel = new Text2('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')', {
size: 40,
fill: 0x000000,
font: 'Comic Sans MS'
});
regularLabel.anchor.set(0.5, 0);
regularLabel.x = 1024;
regularLabel.y = 1970;
game.addChild(regularLabel);
var enhancedLabel = new Text2('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)', {
size: 40,
fill: 0x228B22,
font: 'Comic Sans MS'
});
enhancedLabel.anchor.set(0.5, 0);
enhancedLabel.x = 1024;
enhancedLabel.y = 2170;
game.addChild(enhancedLabel);
// Functions
function spawnCustomer() {
if (customers.length >= pharmacyCapacity) {
return;
}
var customer = new Customer();
var xPositions = [];
for (var i = 0; i < pharmacyCapacity; i++) {
xPositions.push(400 + i * 400);
}
var availablePositions = [];
for (var i = 0; i < xPositions.length; i++) {
var occupied = false;
for (var j = 0; j < customers.length; j++) {
if (Math.abs(customers[j].x - xPositions[i]) < 150) {
occupied = true;
break;
}
}
if (!occupied) {
availablePositions.push(xPositions[i]);
}
}
if (availablePositions.length === 0) {
return;
}
var selectedX = availablePositions[Math.floor(Math.random() * availablePositions.length)];
customer.x = selectedX;
customer.y = 1500;
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 - 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'
};
var baseDesc = typeDescriptions[selectedCustomer.customerType] || 'Regular customer';
info = baseDesc + ' - ' + (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);
timerText.setText('Time: ' + Math.ceil((dayLength - dayTimer) / 60));
}
function nextDay() {
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;
}
// Event handlers
game.update = function () {
if (!gameStarted || !gameRunning) {
return;
}
dayTimer++;
// Check if day time is over
if (dayTimer >= dayLength) {
dayTimer = dayLength; // Prevent timer from going below 0
gameRunning = false;
// Remove all customers without penalty when day ends
for (var i = customers.length - 1; i >= 0; i--) {
customers[i].served = true; // Mark as served to prevent penalty
customers[i].destroy();
}
customers = [];
if (!endOfDayMenu) {
endOfDayMenu = game.addChild(new EndOfDayMenu());
}
return;
}
// Spawn customers randomly - faster with upgrades
var baseSpawnRate = 120;
var adjustedSpawnRate = Math.max(30, baseSpawnRate - customerSpeedUpgrade * 15);
if (LK.ticks % adjustedSpawnRate === 0 && Math.random() < 0.7) {
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 >= 5000) {
LK.showYouWin();
}
// Check lose condition
if (money < 0) {
LK.showGameOver();
}
updateUI();
}; ===================================================================
--- original.js
+++ change.js
@@ -18,9 +18,11 @@
var selectedType = self.isSuspicious ? 'suspiciousCustomer' : customerTypes[Math.floor(Math.random() * customerTypes.length)];
self.customerType = selectedType;
var customerGraphics = self.attachAsset(selectedType, {
anchorX: 0.5,
- anchorY: 1.0
+ 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 () {
@@ -208,14 +210,33 @@
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: 2050,
+ scaleX: 2.5,
+ scaleY: 2.5
+ }));
+ var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
+ var customerSpeedText = new Text2('Upgrade\nCustomer Speed\n$' + customerSpeedCost, {
+ size: 55,
+ fill: 0xFFFFFF,
+ font: 'Comic Sans MS'
+ });
+ customerSpeedText.anchor.set(0.5, 0.5);
+ customerSpeedText.x = 1024;
+ customerSpeedText.y = 2050;
+ self.addChild(customerSpeedText);
// Next day button - bottom right, moved lower
var nextDayButton = self.addChild(LK.getAsset('nextDayButton', {
anchorX: 0.5,
anchorY: 0.5,
x: 1570,
- y: 2050,
+ y: 2350,
scaleX: 1.5,
scaleY: 1.5
}));
var nextDayText = new Text2('Next Day', {
@@ -224,9 +245,9 @@
font: 'Comic Sans MS'
});
nextDayText.anchor.set(0.5, 0.5);
nextDayText.x = 1570;
- nextDayText.y = 2050;
+ nextDayText.y = 2350;
self.addChild(nextDayText);
// Event handlers
capacityButton.down = function (x, y, obj) {
var capacityCost = 150 + (pharmacyCapacity - 3) * 50;
@@ -262,8 +283,17 @@
regularLabel.setText('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')');
enhancedLabel.setText('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)');
}
};
+ customerSpeedButton.down = function (x, y, obj) {
+ var customerSpeedCost = 250 + customerSpeedUpgrade * 75;
+ if (money >= customerSpeedCost) {
+ money -= customerSpeedCost;
+ customerSpeedUpgrade++;
+ earningsText.setText('Total Money: $' + money);
+ customerSpeedText.setText('Upgrade\nCustomer Speed\n$' + (250 + customerSpeedUpgrade * 75));
+ }
+ };
nextDayButton.down = function (x, y, obj) {
nextDay();
self.destroy();
endOfDayMenu = null;
@@ -369,8 +399,9 @@
var gameRunning = false;
var gameStarted = false;
var regularUpgradeBonus = 0;
var enhancedMultiplier = 1.4;
+var customerSpeedUpgrade = 0;
// Add pharmacy background
var pharmacyBg = game.addChild(LK.getAsset('pharmacyBackground', {
anchorX: 0.5,
anchorY: 0.5,
@@ -420,35 +451,39 @@
var counter = game.addChild(LK.getAsset('counter', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
- y: 2000
+ y: 2500
}));
// Medication buttons
var regularButton = game.addChild(new MedicationButton('regular'));
-regularButton.x = 800;
+regularButton.x = 1024;
regularButton.y = 1900;
+regularButton.scaleX = 2;
+regularButton.scaleY = 2;
var enhancedButton = game.addChild(new MedicationButton('enhanced'));
-enhancedButton.x = 1248;
-enhancedButton.y = 1900;
+enhancedButton.x = 1024;
+enhancedButton.y = 2100;
+enhancedButton.scaleX = 2;
+enhancedButton.scaleY = 2;
// Button labels
var regularLabel = new Text2('Regular ($' + (10 + regularUpgradeBonus) + '-' + (20 + regularUpgradeBonus) + ')', {
size: 40,
fill: 0x000000,
font: 'Comic Sans MS'
});
regularLabel.anchor.set(0.5, 0);
-regularLabel.x = 800;
+regularLabel.x = 1024;
regularLabel.y = 1970;
game.addChild(regularLabel);
var enhancedLabel = new Text2('Enhanced (' + enhancedMultiplier.toFixed(1) + 'x profit)', {
size: 40,
fill: 0x228B22,
font: 'Comic Sans MS'
});
enhancedLabel.anchor.set(0.5, 0);
-enhancedLabel.x = 1248;
-enhancedLabel.y = 1970;
+enhancedLabel.x = 1024;
+enhancedLabel.y = 2170;
game.addChild(enhancedLabel);
// Functions
function spawnCustomer() {
if (customers.length >= pharmacyCapacity) {
@@ -456,15 +491,15 @@
}
var customer = new Customer();
var xPositions = [];
for (var i = 0; i < pharmacyCapacity; i++) {
- xPositions.push(300 + i * 500);
+ xPositions.push(400 + i * 400);
}
var availablePositions = [];
for (var i = 0; i < xPositions.length; i++) {
var occupied = false;
for (var j = 0; j < customers.length; j++) {
- if (Math.abs(customers[j].x - xPositions[i]) < 100) {
+ if (Math.abs(customers[j].x - xPositions[i]) < 150) {
occupied = true;
break;
}
}
@@ -553,10 +588,12 @@
endOfDayMenu = game.addChild(new EndOfDayMenu());
}
return;
}
- // Spawn customers randomly
- if (LK.ticks % 120 === 0 && Math.random() < 0.7) {
+ // Spawn customers randomly - faster with upgrades
+ var baseSpawnRate = 120;
+ var adjustedSpawnRate = Math.max(30, baseSpawnRate - customerSpeedUpgrade * 15);
+ if (LK.ticks % adjustedSpawnRate === 0 && Math.random() < 0.7) {
spawnCustomer();
}
// Remove served customers
for (var i = customers.length - 1; i >= 0; i--) {
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