User prompt
Game Genres Research sayfasına Back butonu ekle
User prompt
Araştırma sayfalarına da Back butonu ekle
User prompt
Geri butonunu sayfaların en alt kısmına ekle ve boyutunu diğer boyutlar ile eşitle.
User prompt
Herhangi bir sayfaya girdiğimiz de geri butonu görünsün.
User prompt
Oyuna Yükselt isminde buton ekle. İçerisine Stüdyo seviyesi ekle. Stüdyo seviyesi yükseldikçe yeni çalışan satın alabilelim. Stüdyo seviyesi yükseltme maliyeti olsun. Her çalışanın sadece 1 tane özellik geliştirme özelliği olsun. Bizim kendi ana karakterimiz olsun. Ana karakterimiz Her özellikten 1 tane geliştirme puanına sahip olsun. Ana karakterimizin seviyesini Yükselt butonunun içine ekle. Her seviyede daha güzel oyun yapsın ve her seviyenin kendisine göre maliyeti olsun.
User prompt
Kazanılan score puanını %95 azalt.
User prompt
Kazanç oranı çok yüksek. Genel oyun Kazancını %95 oranında düşür.
User prompt
Oyun isminin sayfa butonunu, oyun geliştirme ekranının ilk botunu yap.
User prompt
Oyun oluşturma ekranında ki market trend ve toplam ücret yazıları alt alta gelsin.
User prompt
Oyun oluşturma ekranında bulunan özellikleri seçmek için butonlar ekle. Bu butonlara oyun oluşturma içinde ki özellikleri taşı. Hangi özelliği seçecek isek butonuna basıp sayfasına girelim.
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in or related to this line: 'game.addChild(notification);' Line Number: 1419
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in or related to this line: 'gameState.researchedFeatures[research.category].push(research.name);' Line Number: 1412
User prompt
Başlangıç parası 10000 olsun
User prompt
Market trendleri, oyunun türüne göre şekillensin. Oyuna birçok özellik ve tür ekle. Ama araştırma yapılması için ana ekrana araştırma butonu ekle. Araştırma butonuna girince, Ses, Grafik, Gameplay ve oyun türü hakkında butonlar oluştur. Bu butonların içine ayrı ayrı 20 çeşit değişik araştırma özellikleri ekle. Bu özellikleri araştırmadan oyun oluştururken seçme ekranında görünmesin.
User prompt
Özelliklerin tamamını %5 aşağı taşı.
User prompt
Total cost kısmını, market trend yazısının 1 satır yukarısına taşı.
User prompt
Özelliklerin tamamını 1 satır aşağı kaydır
User prompt
Market trend yazısı start development bir satır yukarısına taşı.
User prompt
Satış oranları çok yüksek. Oyunlarda ki skor oranları çok yüksek. Oyun özellikleri eklemenin bir maliyeti olsun. Para çok kolay kazanılıyor. Oyunu bayağı zorlaştır. Ayrıca market trend konusu, özellik seçerken görünsün.
User prompt
Seçilen isim oyunun yukarı kenarında görünsün.
User prompt
Oyuna "Bütün Çıkarılan Oyunlar" butonu ekle. Bu botuna basınca geçmişe dönük oyunların listesi görüntülensin. Oradan istediğimiz bir oyuna Basınca geçmişe dönük, hangi oyunu, nasıl özellikle ve hangi çalışanlarla yaptığımız, hangi gün çıkarttığımız ve ne kadar kopya sattı gibi birçok şeyin yazdığı bir sayfaya gitsin.
User prompt
Başlangıçta yalnızca 1 çalışan işe alabilelim. İlerde çalışan sayı güncellemesi yaparak yeni çalışanlar alabileceğiz. Çalışan fiyatlarını 500 ve katları olarak belirle.
User prompt
Oyunun ana sayfasına yeni bir buton ekle. Bu butona basınca yapacağımız oyunun ismini yazalım veya yapacağımız oyunun ismini rastgele sistem belirlesin.
User prompt
Oyuna gün zamanı ekle. Oyun ilk çıktığı gün, çok satsın gün geçtikçe satış oranı düşsün ve bu trend ve doğru tercihler sonucu, oyunun geliştirilme sürecine bağlı olarak değişkenlik göstersin. En sonda da oyun hiç satılmaz duruma gelince, "Oyununuz piyasadan çekildi ve toplam bu kadar kopya sattı" diye bildiri gelsin.
Code edit (1 edits merged)
Please save this source code
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Button = Container.expand(function () { var self = Container.call(this); var bg = self.attachAsset('button', { anchorX: 0.5, anchorY: 0.5 }); var label = new Text2('Button', { size: 40, fill: 0xFFFFFF }); label.anchor.set(0.5, 0.5); self.addChild(label); self.setLabel = function (text) { label.setText(text); }; self.down = function () { tween(bg, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100 }); LK.getSound('select').play(); }; self.up = function () { tween(bg, { scaleX: 1, scaleY: 1 }, { duration: 100 }); if (self.onClick) { self.onClick(); } }; return self; }); var DeveloperCard = Container.expand(function () { var self = Container.call(this); var bg = self.attachAsset('card', { anchorX: 0.5, anchorY: 0.5 }); var icon = self.attachAsset('developerIcon', { anchorX: 0.5, anchorY: 0.5, y: -100 }); var nameText = new Text2('Developer', { size: 30, fill: 0xFFFFFF }); nameText.anchor.set(0.5, 0.5); nameText.y = -20; self.addChild(nameText); var specialtyText = new Text2('Graphics', { size: 25, fill: 0xFFC107 }); specialtyText.anchor.set(0.5, 0.5); specialtyText.y = 20; self.addChild(specialtyText); var costText = new Text2('Cost: $100', { size: 25, fill: 0x4CAF50 }); costText.anchor.set(0.5, 0.5); costText.y = 60; self.addChild(costText); var skillText = new Text2('Skill: 5', { size: 25, fill: 0x2196F3 }); skillText.anchor.set(0.5, 0.5); skillText.y = 100; self.addChild(skillText); self.developerData = null; self.setDeveloper = function (data) { self.developerData = data; nameText.setText(data.name); specialtyText.setText(data.specialty); costText.setText('Cost: $' + data.cost); skillText.setText('Skill: ' + data.skill); var specialtyColors = { 'Graphics': 0xff5722, 'Sound': 0x9c27b0, 'Gameplay': 0x2196f3 }; icon.tint = specialtyColors[data.specialty] || 0xffc107; }; self.down = function () { if (self.onClick) { self.onClick(self.developerData); } }; return self; }); var FeatureCard = Container.expand(function () { var self = Container.call(this); var bg = self.attachAsset('card', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.8, scaleY: 0.8 }); var icon = self.attachAsset('featureIcon', { anchorX: 0.5, anchorY: 0.5, y: -80 }); var nameText = new Text2('Feature', { size: 25, fill: 0xFFFFFF }); nameText.anchor.set(0.5, 0.5); nameText.y = -20; self.addChild(nameText); var typeText = new Text2('Type', { size: 20, fill: 0x2196F3 }); typeText.anchor.set(0.5, 0.5); typeText.y = 10; self.addChild(typeText); var pointsText = new Text2('Points: 0', { size: 20, fill: 0x4CAF50 }); pointsText.anchor.set(0.5, 0.5); pointsText.y = 40; self.addChild(pointsText); self.featureData = null; self.selected = false; self.setFeature = function (data) { self.featureData = data; nameText.setText(data.name); typeText.setText(data.type); pointsText.setText('Points: ' + data.basePoints); var typeColors = { 'Graphics': 0xff5722, 'Sound': 0x9c27b0, 'Gameplay': 0x2196f3 }; icon.tint = typeColors[data.type] || 0xffc107; }; self.setSelected = function (selected) { self.selected = selected; bg.tint = selected ? 0xe94560 : 0xffffff; }; self.down = function () { if (self.onClick) { self.onClick(self); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ // Game state var gameState = { money: 1000, developers: [], currentProject: null, completedGames: 0, marketTrends: [], currentDay: 1, releasedGames: [] }; // Available developers pool var developerPool = [{ name: 'Alex', specialty: 'Graphics', skill: 3, cost: 100 }, { name: 'Sam', specialty: 'Sound', skill: 4, cost: 150 }, { name: 'Jordan', specialty: 'Gameplay', skill: 5, cost: 200 }, { name: 'Morgan', specialty: 'Graphics', skill: 6, cost: 300 }, { name: 'Casey', specialty: 'Sound', skill: 7, cost: 400 }, { name: 'Drew', specialty: 'Gameplay', skill: 8, cost: 500 }]; // Available features var featurePool = [{ name: 'Pixel Art', type: 'Graphics', basePoints: 3 }, { name: '3D Models', type: 'Graphics', basePoints: 5 }, { name: 'Particle Effects', type: 'Graphics', basePoints: 4 }, { name: 'Soundtrack', type: 'Sound', basePoints: 3 }, { name: 'Voice Acting', type: 'Sound', basePoints: 6 }, { name: 'Sound Effects', type: 'Sound', basePoints: 4 }, { name: 'RPG Elements', type: 'Gameplay', basePoints: 5 }, { name: 'Multiplayer', type: 'Gameplay', basePoints: 7 }, { name: 'Puzzles', type: 'Gameplay', basePoints: 4 }, { name: 'Open World', type: 'Gameplay', basePoints: 8 }]; // UI Elements var moneyText = new Text2('Money: $1000', { size: 50, fill: 0x4CAF50 }); moneyText.anchor.set(1, 0); LK.gui.topRight.addChild(moneyText); var developersText = new Text2('Developers: 0', { size: 40, fill: 0xFFFFFF }); developersText.anchor.set(1, 0); developersText.y = 60; LK.gui.topRight.addChild(developersText); var gamesText = new Text2('Games Released: 0', { size: 40, fill: 0xFFC107 }); gamesText.anchor.set(1, 0); gamesText.y = 110; LK.gui.topRight.addChild(gamesText); var dayText = new Text2('Day: 1', { size: 40, fill: 0x2196F3 }); dayText.anchor.set(1, 0); dayText.y = 160; LK.gui.topRight.addChild(dayText); // Main menu container var mainMenu = new Container(); game.addChild(mainMenu); var titleText = new Text2('Game Dev Studio', { size: 80, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 300; mainMenu.addChild(titleText); var hireDeveloperBtn = new Button(); hireDeveloperBtn.setLabel('Hire Developer'); hireDeveloperBtn.x = 1024; hireDeveloperBtn.y = 600; hireDeveloperBtn.onClick = showHireMenu; mainMenu.addChild(hireDeveloperBtn); var startProjectBtn = new Button(); startProjectBtn.setLabel('Start Project'); startProjectBtn.x = 1024; startProjectBtn.y = 750; startProjectBtn.onClick = showProjectMenu; mainMenu.addChild(startProjectBtn); // Hire menu container var hireMenu = new Container(); hireMenu.visible = false; game.addChild(hireMenu); var hireTitle = new Text2('Hire Developer', { size: 60, fill: 0xFFFFFF }); hireTitle.anchor.set(0.5, 0.5); hireTitle.x = 1024; hireTitle.y = 200; hireMenu.addChild(hireTitle); var backFromHireBtn = new Button(); backFromHireBtn.setLabel('Back'); backFromHireBtn.x = 1024; backFromHireBtn.y = 2400; backFromHireBtn.onClick = function () { hireMenu.visible = false; mainMenu.visible = true; }; hireMenu.addChild(backFromHireBtn); // Project menu container var projectMenu = new Container(); projectMenu.visible = false; game.addChild(projectMenu); var projectTitle = new Text2('New Project', { size: 60, fill: 0xFFFFFF }); projectTitle.anchor.set(0.5, 0.5); projectTitle.x = 1024; projectTitle.y = 200; projectMenu.addChild(projectTitle); var selectFeaturesText = new Text2('Select 5 Features:', { size: 40, fill: 0xFFFFFF }); selectFeaturesText.anchor.set(0.5, 0.5); selectFeaturesText.x = 1024; selectFeaturesText.y = 300; projectMenu.addChild(selectFeaturesText); var startDevelopmentBtn = new Button(); startDevelopmentBtn.setLabel('Start Development'); startDevelopmentBtn.x = 1024; startDevelopmentBtn.y = 2200; startDevelopmentBtn.onClick = startDevelopment; projectMenu.addChild(startDevelopmentBtn); var backFromProjectBtn = new Button(); backFromProjectBtn.setLabel('Back'); backFromProjectBtn.x = 1024; backFromProjectBtn.y = 2350; backFromProjectBtn.onClick = function () { projectMenu.visible = false; mainMenu.visible = true; selectedFeatures = []; featureCards.forEach(function (card) { card.setSelected(false); }); }; projectMenu.addChild(backFromProjectBtn); // Development screen var developmentScreen = new Container(); developmentScreen.visible = false; game.addChild(developmentScreen); var devTitle = new Text2('Developing Game', { size: 60, fill: 0xFFFFFF }); devTitle.anchor.set(0.5, 0.5); devTitle.x = 1024; devTitle.y = 200; developmentScreen.addChild(devTitle); var targetScoreText = new Text2('Target Score: 100', { size: 40, fill: 0xFFFFFF }); targetScoreText.anchor.set(0.5, 0.5); targetScoreText.x = 1024; targetScoreText.y = 400; developmentScreen.addChild(targetScoreText); var currentScoreText = new Text2('Current Score: 0', { size: 40, fill: 0x4CAF50 }); currentScoreText.anchor.set(0.5, 0.5); currentScoreText.x = 1024; currentScoreText.y = 500; developmentScreen.addChild(currentScoreText); var progressBarBg = LK.getAsset('progressBar', { anchorX: 0.5, anchorY: 0.5 }); progressBarBg.x = 1024; progressBarBg.y = 700; developmentScreen.addChild(progressBarBg); var progressBarFill = LK.getAsset('progressFill', { anchorX: 0, anchorY: 0.5 }); progressBarFill.x = 624; progressBarFill.y = 700; progressBarFill.scaleX = 0; developmentScreen.addChild(progressBarFill); var releaseBtn = new Button(); releaseBtn.setLabel('Release Game!'); releaseBtn.x = 1024; releaseBtn.y = 900; releaseBtn.visible = false; releaseBtn.onClick = releaseGame; developmentScreen.addChild(releaseBtn); // Market trends display var trendsContainer = new Container(); trendsContainer.x = 1024; trendsContainer.y = 1200; developmentScreen.addChild(trendsContainer); var trendsTitle = new Text2('Market Trends:', { size: 35, fill: 0xFF5722 }); trendsTitle.anchor.set(0.5, 0.5); trendsContainer.addChild(trendsTitle); // Arrays for UI elements var developerCards = []; var featureCards = []; var selectedFeatures = []; // Functions function updateUI() { moneyText.setText('Money: $' + gameState.money); developersText.setText('Developers: ' + gameState.developers.length); gamesText.setText('Games Released: ' + gameState.completedGames); dayText.setText('Day: ' + gameState.currentDay); } function showHireMenu() { mainMenu.visible = false; hireMenu.visible = true; // Clear existing cards developerCards.forEach(function (card) { card.destroy(); }); developerCards = []; // Create developer cards var availableDevelopers = developerPool.filter(function (dev) { return !gameState.developers.some(function (hired) { return hired.name === dev.name; }); }); availableDevelopers.forEach(function (dev, index) { var card = new DeveloperCard(); card.setDeveloper(dev); card.x = 512 + index % 3 * 350; card.y = 600 + Math.floor(index / 3) * 450; card.onClick = function (developer) { if (gameState.money >= developer.cost) { gameState.money -= developer.cost; gameState.developers.push(developer); updateUI(); LK.getSound('hire').play(); showHireMenu(); // Refresh menu } }; hireMenu.addChild(card); developerCards.push(card); }); } function showProjectMenu() { if (gameState.developers.length === 0) { return; } mainMenu.visible = false; projectMenu.visible = true; selectedFeatures = []; // Clear existing cards featureCards.forEach(function (card) { card.destroy(); }); featureCards = []; // Create feature cards featurePool.forEach(function (feature, index) { var card = new FeatureCard(); card.setFeature(feature); card.x = 400 + index % 4 * 250; card.y = 600 + Math.floor(index / 4) * 350; card.onClick = function (clickedCard) { if (clickedCard.selected) { clickedCard.setSelected(false); selectedFeatures = selectedFeatures.filter(function (f) { return f !== clickedCard.featureData; }); } else if (selectedFeatures.length < 5) { clickedCard.setSelected(true); selectedFeatures.push(clickedCard.featureData); LK.getSound('select').play(); } }; projectMenu.addChild(card); featureCards.push(card); }); } function startDevelopment() { if (selectedFeatures.length !== 5) { return; } projectMenu.visible = false; developmentScreen.visible = true; // Generate market trends gameState.marketTrends = []; var trendTypes = ['Graphics', 'Sound', 'Gameplay']; for (var i = 0; i < 2; i++) { var trend = trendTypes[Math.floor(Math.random() * trendTypes.length)]; gameState.marketTrends.push(trend); } // Display trends for (var i = trendsContainer.children.length - 1; i > 0; i--) { trendsContainer.children[i].destroy(); } gameState.marketTrends.forEach(function (trend, index) { var trendText = new Text2(trend + ' is trending!', { size: 30, fill: 0xFF5722 }); trendText.anchor.set(0.5, 0.5); trendText.y = 40 + index * 35; trendsContainer.addChild(trendText); }); // Calculate target score var baseTarget = 50 + gameState.completedGames * 25; targetScoreText.setText('Target Score: ' + baseTarget); // Start project gameState.currentProject = { features: selectedFeatures, targetScore: baseTarget, currentScore: 0, developmentSpeed: 0 }; // Calculate development speed var totalSpeed = 0; gameState.developers.forEach(function (dev) { totalSpeed += dev.skill * 0.5; }); gameState.currentProject.developmentSpeed = totalSpeed; LK.getSound('develop').play(); releaseBtn.visible = false; progressBarFill.scaleX = 0; } function releaseGame() { var project = gameState.currentProject; // Calculate final score with bonuses var finalScore = project.currentScore; // Trend bonus var trendMultiplier = 1; project.features.forEach(function (feature) { if (gameState.marketTrends.indexOf(feature.type) !== -1) { finalScore *= 1.5; trendMultiplier += 0.3; } }); // Calculate initial sales potential var baseSalesMultiplier = 100; if (finalScore >= project.targetScore) { baseSalesMultiplier = 200; } var initialDailySales = Math.floor(finalScore / project.targetScore * baseSalesMultiplier * trendMultiplier); var releasedGame = { name: 'Game #' + (gameState.completedGames + 1), releaseDay: gameState.currentDay, score: finalScore, targetScore: project.targetScore, initialDailySales: initialDailySales, currentDailySales: initialDailySales, totalSales: 0, features: project.features, trendBonus: trendMultiplier }; gameState.releasedGames.push(releasedGame); // Success check if (finalScore >= project.targetScore) { gameState.money += Math.floor(finalScore * 10); gameState.completedGames++; LK.getSound('success').play(); LK.setScore(gameState.completedGames); if (gameState.completedGames >= 10) { LK.showYouWin(); } } else { gameState.money += Math.floor(finalScore * 2); } LK.getSound('release').play(); // Reset gameState.currentProject = null; developmentScreen.visible = false; mainMenu.visible = true; updateUI(); } // Game update var dayTimer = 0; game.update = function () { // Day progression (every 3 seconds = 1 day) dayTimer++; if (dayTimer >= 180) { // 60 fps * 3 seconds dayTimer = 0; gameState.currentDay++; updateUI(); // Process game sales for (var i = gameState.releasedGames.length - 1; i >= 0; i--) { var game = gameState.releasedGames[i]; var daysSinceRelease = gameState.currentDay - game.releaseDay; // Calculate sales decline var declineRate = 0.85; // Base 15% daily decline // Better games decline slower if (game.score >= game.targetScore * 1.5) { declineRate = 0.92; } else if (game.score >= game.targetScore) { declineRate = 0.88; } // Apply trend bonus to decline rate declineRate += (game.trendBonus - 1) * 0.05; declineRate = Math.min(declineRate, 0.95); // Calculate current day sales game.currentDailySales = Math.floor(game.initialDailySales * Math.pow(declineRate, daysSinceRelease)); // Add to total sales and money if (game.currentDailySales > 0) { game.totalSales += game.currentDailySales; var revenue = Math.floor(game.currentDailySales * 10); gameState.money += revenue; } else { // Game no longer selling - remove from market gameState.releasedGames.splice(i, 1); // Show notification var notification = new Container(); game.addChild(notification); var bg = LK.getAsset('card', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 1.2 }); bg.tint = 0x0f3460; notification.addChild(bg); var titleText = new Text2(game.name + ' removed from market', { size: 35, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0.5); titleText.y = -30; notification.addChild(titleText); var salesText = new Text2('Total copies sold: ' + game.totalSales, { size: 30, fill: 0x4CAF50 }); salesText.anchor.set(0.5, 0.5); salesText.y = 20; notification.addChild(salesText); notification.x = 1024; notification.y = 1366; notification.alpha = 0; // Animate notification tween(notification, { alpha: 1, y: 1000 }, { duration: 500, onFinish: function onFinish() { LK.setTimeout(function () { tween(notification, { alpha: 0 }, { duration: 500, onFinish: function onFinish() { notification.destroy(); } }); }, 2000); } }); } } updateUI(); } if (gameState.currentProject && developmentScreen.visible) { var project = gameState.currentProject; // Development progress if (project.currentScore < project.targetScore * 10) { // Calculate points per tick var pointsPerTick = project.developmentSpeed / 30; // Feature synergy bonus var synergy = 1; project.features.forEach(function (feature) { gameState.developers.forEach(function (dev) { if (dev.specialty === feature.type) { synergy += 0.1; } }); }); project.currentScore += pointsPerTick * synergy; // Update UI currentScoreText.setText('Current Score: ' + Math.floor(project.currentScore)); var progress = Math.min(project.currentScore / (project.targetScore * 10), 1); progressBarFill.scaleX = progress; // Show release button when ready if (progress >= 1 && !releaseBtn.visible) { releaseBtn.visible = true; tween(releaseBtn, { scaleX: 1.1, scaleY: 1.1 }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { tween(releaseBtn, { scaleX: 1, scaleY: 1 }, { duration: 500 }); } }); } } } // Check game over if (gameState.money < 100 && gameState.developers.length === 0 && !gameState.currentProject) { LK.showGameOver(); } }; // Initialize updateUI();
===================================================================
--- original.js
+++ change.js
@@ -179,9 +179,11 @@
money: 1000,
developers: [],
currentProject: null,
completedGames: 0,
- marketTrends: []
+ marketTrends: [],
+ currentDay: 1,
+ releasedGames: []
};
// Available developers pool
var developerPool = [{
name: 'Alex',
@@ -276,8 +278,15 @@
});
gamesText.anchor.set(1, 0);
gamesText.y = 110;
LK.gui.topRight.addChild(gamesText);
+var dayText = new Text2('Day: 1', {
+ size: 40,
+ fill: 0x2196F3
+});
+dayText.anchor.set(1, 0);
+dayText.y = 160;
+LK.gui.topRight.addChild(dayText);
// Main menu container
var mainMenu = new Container();
game.addChild(mainMenu);
var titleText = new Text2('Game Dev Studio', {
@@ -429,8 +438,9 @@
function updateUI() {
moneyText.setText('Money: $' + gameState.money);
developersText.setText('Developers: ' + gameState.developers.length);
gamesText.setText('Games Released: ' + gameState.completedGames);
+ dayText.setText('Day: ' + gameState.currentDay);
}
function showHireMenu() {
mainMenu.visible = false;
hireMenu.visible = true;
@@ -547,13 +557,33 @@
var project = gameState.currentProject;
// Calculate final score with bonuses
var finalScore = project.currentScore;
// Trend bonus
+ var trendMultiplier = 1;
project.features.forEach(function (feature) {
if (gameState.marketTrends.indexOf(feature.type) !== -1) {
finalScore *= 1.5;
+ trendMultiplier += 0.3;
}
});
+ // Calculate initial sales potential
+ var baseSalesMultiplier = 100;
+ if (finalScore >= project.targetScore) {
+ baseSalesMultiplier = 200;
+ }
+ var initialDailySales = Math.floor(finalScore / project.targetScore * baseSalesMultiplier * trendMultiplier);
+ var releasedGame = {
+ name: 'Game #' + (gameState.completedGames + 1),
+ releaseDay: gameState.currentDay,
+ score: finalScore,
+ targetScore: project.targetScore,
+ initialDailySales: initialDailySales,
+ currentDailySales: initialDailySales,
+ totalSales: 0,
+ features: project.features,
+ trendBonus: trendMultiplier
+ };
+ gameState.releasedGames.push(releasedGame);
// Success check
if (finalScore >= project.targetScore) {
gameState.money += Math.floor(finalScore * 10);
gameState.completedGames++;
@@ -572,9 +602,93 @@
mainMenu.visible = true;
updateUI();
}
// Game update
+var dayTimer = 0;
game.update = function () {
+ // Day progression (every 3 seconds = 1 day)
+ dayTimer++;
+ if (dayTimer >= 180) {
+ // 60 fps * 3 seconds
+ dayTimer = 0;
+ gameState.currentDay++;
+ updateUI();
+ // Process game sales
+ for (var i = gameState.releasedGames.length - 1; i >= 0; i--) {
+ var game = gameState.releasedGames[i];
+ var daysSinceRelease = gameState.currentDay - game.releaseDay;
+ // Calculate sales decline
+ var declineRate = 0.85; // Base 15% daily decline
+ // Better games decline slower
+ if (game.score >= game.targetScore * 1.5) {
+ declineRate = 0.92;
+ } else if (game.score >= game.targetScore) {
+ declineRate = 0.88;
+ }
+ // Apply trend bonus to decline rate
+ declineRate += (game.trendBonus - 1) * 0.05;
+ declineRate = Math.min(declineRate, 0.95);
+ // Calculate current day sales
+ game.currentDailySales = Math.floor(game.initialDailySales * Math.pow(declineRate, daysSinceRelease));
+ // Add to total sales and money
+ if (game.currentDailySales > 0) {
+ game.totalSales += game.currentDailySales;
+ var revenue = Math.floor(game.currentDailySales * 10);
+ gameState.money += revenue;
+ } else {
+ // Game no longer selling - remove from market
+ gameState.releasedGames.splice(i, 1);
+ // Show notification
+ var notification = new Container();
+ game.addChild(notification);
+ var bg = LK.getAsset('card', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 2,
+ scaleY: 1.2
+ });
+ bg.tint = 0x0f3460;
+ notification.addChild(bg);
+ var titleText = new Text2(game.name + ' removed from market', {
+ size: 35,
+ fill: 0xFFFFFF
+ });
+ titleText.anchor.set(0.5, 0.5);
+ titleText.y = -30;
+ notification.addChild(titleText);
+ var salesText = new Text2('Total copies sold: ' + game.totalSales, {
+ size: 30,
+ fill: 0x4CAF50
+ });
+ salesText.anchor.set(0.5, 0.5);
+ salesText.y = 20;
+ notification.addChild(salesText);
+ notification.x = 1024;
+ notification.y = 1366;
+ notification.alpha = 0;
+ // Animate notification
+ tween(notification, {
+ alpha: 1,
+ y: 1000
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ LK.setTimeout(function () {
+ tween(notification, {
+ alpha: 0
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ notification.destroy();
+ }
+ });
+ }, 2000);
+ }
+ });
+ }
+ }
+ updateUI();
+ }
if (gameState.currentProject && developmentScreen.visible) {
var project = gameState.currentProject;
// Development progress
if (project.currentScore < project.targetScore * 10) {