User prompt
Make the upgrade lab bigger
User prompt
Move the research button lower
User prompt
Move the button lower
User prompt
Move the research button twice as high
User prompt
Move it higher
User prompt
Move the research button higher
User prompt
Move the upgrade lab above the research button
User prompt
Move hire developer slightly to the left and make it bigger
User prompt
Move the hire button to the bottom right
User prompt
Move hire developer to the bottom left, move the research button slightly to the right
User prompt
Move the research button to the bottom left and make it bigger
User prompt
Move the purchasable buttons a little higher
User prompt
Move the purchasable buttons to the bottom middle
User prompt
Make the UI elements slightly bigger
Code edit (1 edits merged)
Please save this source code
User prompt
AI Tycoon: Intelligence Empire
Initial prompt
Create a tycoon based off of different types of AI
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
funds: 10000,
developers: 1,
techLevel: 1,
reputation: 1,
projects: [],
lastTimestamp: "undefined"
});
/****
* Classes
****/
var Button = Container.expand(function (label, color) {
var self = Container.call(this);
var asset = self.attachAsset('researchButton', {
anchorX: 0.5,
anchorY: 0.5
});
if (color !== undefined) {
asset.tint = color;
}
var labelText = new Text2(label, {
size: 24,
fill: 0xFFFFFF
});
labelText.anchor.set(0.5, 0.5);
self.addChild(labelText);
var costText = new Text2("", {
size: 18,
fill: 0xFFFFFF
});
costText.anchor.set(0.5, 0.5);
costText.y = 25;
self.addChild(costText);
self.setCost = function (cost) {
if (cost > 0) {
costText.setText("$" + cost.toLocaleString());
} else {
costText.setText("");
}
};
self.setEnabled = function (enabled) {
self.alpha = enabled ? 1.0 : 0.5;
};
self.down = function (x, y, obj) {
if (self.alpha === 1.0) {
LK.effects.flashObject(self, 0xffffff, 200);
}
};
return self;
});
var ProjectCard = Container.expand(function () {
var self = Container.call(this);
var background = self.attachAsset('projectCard', {
anchorX: 0.5,
anchorY: 0.5
});
var titleText = new Text2("AI Project", {
size: 28,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0);
titleText.y = -70;
self.addChild(titleText);
var descText = new Text2("", {
size: 18,
fill: 0xFFFFFF
});
descText.anchor.set(0.5, 0);
descText.y = -30;
self.addChild(descText);
var rewardText = new Text2("", {
size: 20,
fill: 0xFFFF00
});
rewardText.anchor.set(0.5, 0);
rewardText.y = 20;
self.addChild(rewardText);
var statusText = new Text2("", {
size: 16,
fill: 0xFFFFFF
});
statusText.anchor.set(0.5, 0);
statusText.y = 50;
self.addChild(statusText);
self.projectId = 0;
self.title = "";
self.desc = "";
self.reward = 0;
self.devCost = 0;
self.timeToComplete = 0;
self.progress = 0;
self.isComplete = false;
self.setProject = function (id, title, desc, reward, devCost, timeToComplete) {
self.projectId = id;
self.title = title;
self.desc = desc;
self.reward = reward;
self.devCost = devCost;
self.timeToComplete = timeToComplete;
self.progress = 0;
self.isComplete = false;
titleText.setText(title);
descText.setText(desc);
rewardText.setText("Reward: $" + reward.toLocaleString());
self.updateStatus();
};
self.updateStatus = function () {
if (self.isComplete) {
statusText.setText("COMPLETE!");
background.tint = 0x27ae60;
} else {
var progressPercent = Math.min(100, Math.floor(self.progress / self.timeToComplete * 100));
statusText.setText("Progress: " + progressPercent + "%");
background.tint = 0x95a5a6;
}
};
self.update = function (deltaTime, activeDevelopers) {
if (!self.isComplete) {
if (activeDevelopers > 0) {
self.progress += deltaTime * activeDevelopers;
if (self.progress >= self.timeToComplete) {
self.isComplete = true;
self.progress = self.timeToComplete;
LK.getSound('project').play();
}
self.updateStatus();
}
}
};
self.down = function (x, y, obj) {
if (self.isComplete) {
game.collectProjectReward(self);
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c3e50
});
/****
* Game Code
****/
// Game state
var funds = storage.funds;
var developers = storage.developers;
var techLevel = storage.techLevel;
var reputation = storage.reputation;
var projects = [];
var lastUpdateTime = Date.now();
var freeDevelopers = developers;
var autoSaveInterval = 10000; // Save every 10 seconds
var lastSaveTime = Date.now();
// Game balancing
var techUpgradeCost = function techUpgradeCost(level) {
return Math.floor(5000 * Math.pow(2, level - 1));
};
var developerHireCost = function developerHireCost(count) {
return Math.floor(2000 * Math.pow(1.5, count - 1));
};
var possibleProjects = [
// [title, description, baseReward, devCost, timeToComplete]
["Basic Chatbot", "Create a simple rule-based chatbot for customer service", 3000, 1, 10000], ["Recommendation System", "Build a product recommendation algorithm", 8000, 1, 20000], ["Image Recognition", "Develop an image classification system", 15000, 2, 30000], ["Voice Assistant", "Create a voice-controlled assistant app", 25000, 2, 40000], ["Financial Forecasting", "AI system to predict market trends", 40000, 3, 50000], ["Autonomous Navigation", "Self-driving vehicle algorithms", 80000, 3, 70000], ["Healthcare Diagnosis", "AI system to assist medical diagnoses", 100000, 4, 80000], ["Natural Language Processing", "Advanced text understanding system", 150000, 4, 100000], ["Neural Network Platform", "Create a flexible neural network framework", 300000, 5, 120000], ["Quantum AI", "Cutting-edge quantum computing AI algorithms", 500000, 5, 150000]];
// Create UI elements
// Company stats
var statsPanel = game.addChild(new Container());
statsPanel.x = 50;
statsPanel.y = 50;
var companyText = new Text2("Your AI Company", {
size: 50,
fill: 0xFFFFFF
});
statsPanel.addChild(companyText);
var fundsText = new Text2("Funds: $" + funds.toLocaleString(), {
size: 40,
fill: 0xFFFFFF
});
fundsText.y = 60;
statsPanel.addChild(fundsText);
var developersText = new Text2("Developers: " + developers, {
size: 40,
fill: 0xFFFFFF
});
developersText.y = 100;
statsPanel.addChild(developersText);
var techLevelText = new Text2("Tech Level: " + techLevel, {
size: 40,
fill: 0xFFFFFF
});
techLevelText.y = 140;
statsPanel.addChild(techLevelText);
var reputationText = new Text2("Reputation: " + reputation, {
size: 40,
fill: 0xFFFFFF
});
reputationText.y = 180;
statsPanel.addChild(reputationText);
var freeDevelopersText = new Text2("Available Developers: " + freeDevelopers, {
size: 40,
fill: 0xFFFFFF
});
freeDevelopersText.y = 220;
statsPanel.addChild(freeDevelopersText);
// Create button panel
var buttonPanel = game.addChild(new Container());
buttonPanel.x = 1024; // Center horizontally
buttonPanel.y = 2400; // Position slightly higher
var researchButton = new Button("Research");
researchButton.setCost(techUpgradeCost(techLevel));
researchButton.x = 300; // Move slightly to the right
researchButton.y = 2600; // Adjust vertical position
researchButton.scaleX = 1.5; // Make it bigger
researchButton.scaleY = 1.5; // Make it bigger
game.addChild(researchButton);
var hireButton = new Button("Hire Developer");
hireButton.x = 1800; // Move slightly to the left
hireButton.y = 2600; // Adjust vertical position
hireButton.scaleX = 1.5; // Make it bigger
hireButton.scaleY = 1.5; // Make it bigger
hireButton.setCost(developerHireCost(developers));
game.addChild(hireButton);
var upgradeLabButton = new Button("Upgrade Lab");
upgradeLabButton.y = 200; // Adjust vertical position
upgradeLabButton.setCost(10000 * reputation);
buttonPanel.addChild(upgradeLabButton);
var seekInvestmentButton = new Button("Seek Investment");
seekInvestmentButton.y = 300; // Adjust vertical position
seekInvestmentButton.setCost(0);
buttonPanel.addChild(seekInvestmentButton);
// Create AI lab
var aiLab = game.addChild(new Container());
aiLab.x = 1500;
aiLab.y = 300;
var labBackground = aiLab.attachAsset('aiLab', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 5,
scaleY: 5
});
var labTitleText = new Text2("AI Research Lab", {
size: 50,
fill: 0xFFFFFF
});
labTitleText.anchor.set(0.5, 0.5);
labTitleText.y = -400;
aiLab.addChild(labTitleText);
// Projects area
var projectsContainer = game.addChild(new Container());
projectsContainer.x = 500;
projectsContainer.y = 700;
var projectsTitle = new Text2("Active Projects", {
size: 50,
fill: 0xFFFFFF
});
projectsTitle.anchor.set(0.5, 0);
projectsTitle.x = 524;
projectsTitle.y = 0;
projectsContainer.addChild(projectsTitle);
var startProjectButton = new Button("Start New Project");
startProjectButton.x = 524;
startProjectButton.y = 70;
projectsContainer.addChild(startProjectButton);
var projectCards = [];
var maxVisibleProjects = 3;
// Game functions
function updateUI() {
fundsText.setText("Funds: $" + funds.toLocaleString());
developersText.setText("Developers: " + developers);
techLevelText.setText("Tech Level: " + techLevel);
reputationText.setText("Reputation: " + reputation);
freeDevelopersText.setText("Available Developers: " + freeDevelopers);
researchButton.setCost(techUpgradeCost(techLevel));
hireButton.setCost(developerHireCost(developers));
upgradeLabButton.setCost(10000 * reputation);
researchButton.setEnabled(funds >= techUpgradeCost(techLevel));
hireButton.setEnabled(funds >= developerHireCost(developers));
upgradeLabButton.setEnabled(funds >= 10000 * reputation);
startProjectButton.setEnabled(freeDevelopers > 0 && projectCards.length < maxVisibleProjects);
}
function startNewProject() {
if (freeDevelopers <= 0 || projectCards.length >= maxVisibleProjects) {
return;
}
// Filter projects based on tech level
var availableProjects = possibleProjects.filter(function (project) {
return Math.ceil(project[2] / 5000) <= techLevel;
});
if (availableProjects.length === 0) {
return;
}
// Select a random project weighted by tech level
var selectedProject = availableProjects[Math.min(Math.floor(Math.random() * availableProjects.length * 0.8 + 0.2 * availableProjects.length), availableProjects.length - 1)];
// Create project with scaling based on tech level and reputation
var rewardMultiplier = 1 + (reputation - 1) * 0.2;
var timeReduction = Math.max(0, 1 - (techLevel - 1) * 0.05);
var projectCard = new ProjectCard();
projectCard.setProject(Date.now(), selectedProject[0], selectedProject[1], Math.floor(selectedProject[2] * rewardMultiplier), selectedProject[3], Math.floor(selectedProject[4] * timeReduction));
// Position the card
var cardIndex = projectCards.length;
projectCard.x = 150 + cardIndex * 350;
projectCard.y = 200;
// Add to game
projectsContainer.addChild(projectCard);
projectCards.push(projectCard);
// Assign developers
var devsToAssign = Math.min(freeDevelopers, projectCard.devCost);
freeDevelopers -= devsToAssign;
LK.getSound('project').play();
updateUI();
}
game.collectProjectReward = function (projectCard) {
// Add reward to funds
funds += projectCard.reward;
// Increase reputation
reputation += 0.1;
// Free up developers
freeDevelopers += projectCard.devCost;
// Remove project card
var index = projectCards.indexOf(projectCard);
if (index !== -1) {
projectCards.splice(index, 1);
projectCard.destroy();
// Reposition remaining cards
for (var i = 0; i < projectCards.length; i++) {
tween(projectCards[i], {
x: 150 + i * 350
}, {
duration: 300
});
}
}
updateUI();
};
function saveGameState() {
storage.funds = funds;
storage.developers = developers;
storage.techLevel = techLevel;
storage.reputation = reputation;
storage.lastTimestamp = Date.now();
// We don't save projects as they're ephemeral
lastSaveTime = Date.now();
}
function processOfflineProgress() {
if (!storage.lastTimestamp) {
return;
}
var currentTime = Date.now();
var timeDifference = currentTime - storage.lastTimestamp;
if (timeDifference > 5000) {
// Only process if more than 5 seconds passed
// Generate passive income based on reputation and tech level
var hourlyRate = 100 * reputation * techLevel;
var offlineEarnings = Math.floor(hourlyRate / 3600000 * timeDifference);
if (offlineEarnings > 0) {
funds += offlineEarnings;
var notificationText = new Text2("Earned $" + offlineEarnings.toLocaleString() + " while away!", {
size: 30,
fill: 0xFFFFFF
});
notificationText.anchor.set(0.5, 0.5);
notificationText.x = 1024;
notificationText.y = 1366;
game.addChild(notificationText);
tween(notificationText, {
y: 1200,
alpha: 0
}, {
duration: 3000,
onFinish: function onFinish() {
notificationText.destroy();
}
});
}
}
}
// Button handlers
researchButton.down = function (x, y, obj) {
if (funds >= techUpgradeCost(techLevel)) {
funds -= techUpgradeCost(techLevel);
techLevel++;
LK.getSound('research').play();
// Flash effect on the lab
LK.effects.flashObject(labBackground, 0x3498db, 500);
updateUI();
}
};
hireButton.down = function (x, y, obj) {
if (funds >= developerHireCost(developers)) {
funds -= developerHireCost(developers);
developers++;
freeDevelopers++;
LK.getSound('hire').play();
updateUI();
}
};
upgradeLabButton.down = function (x, y, obj) {
if (funds >= 10000 * reputation) {
funds -= 10000 * reputation;
reputation += 0.5;
LK.getSound('upgrade').play();
// Scale up the lab slightly to show growth
var newScale = Math.min(7, labBackground.scale.x + 0.2);
tween(labBackground.scale, {
x: newScale,
y: newScale
}, {
duration: 500
});
updateUI();
}
};
seekInvestmentButton.down = function (x, y, obj) {
// Investment amount based on tech level and reputation
var investmentAmount = Math.floor(5000 * techLevel * reputation);
funds += investmentAmount;
LK.getSound('investment').play();
// Show investment notification
var investmentText = new Text2("Received $" + investmentAmount.toLocaleString() + " investment!", {
size: 30,
fill: 0x00FF00
});
investmentText.anchor.set(0.5, 0.5);
investmentText.x = 1024;
investmentText.y = 1366;
game.addChild(investmentText);
tween(investmentText, {
y: 1200,
alpha: 0
}, {
duration: 3000,
onFinish: function onFinish() {
investmentText.destroy();
}
});
// Disable button for a while
seekInvestmentButton.setEnabled(false);
LK.setTimeout(function () {
seekInvestmentButton.setEnabled(true);
}, 60000); // 1 minute cooldown
updateUI();
};
startProjectButton.down = function (x, y, obj) {
if (freeDevelopers > 0 && projectCards.length < maxVisibleProjects) {
startNewProject();
}
};
// Game loop
game.update = function () {
var currentTime = Date.now();
var deltaTime = currentTime - lastUpdateTime;
lastUpdateTime = currentTime;
// Update projects
for (var i = 0; i < projectCards.length; i++) {
// Allocate at least 1 developer to each project if possible
var devCount = Math.max(1, Math.floor(projectCards[i].devCost));
projectCards[i].update(deltaTime, devCount);
}
// Auto-save periodically
if (currentTime - lastSaveTime > autoSaveInterval) {
saveGameState();
}
// Small chance to get a random event
if (Math.random() < 0.0005) {
// Roughly once every ~33 seconds
triggerRandomEvent();
}
};
function triggerRandomEvent() {
var events = [{
message: "Viral AI demo boosts reputation!",
effect: function effect() {
reputation += 0.3;
tween(labBackground, {
tint: 0x2ecc71
}, {
duration: 1000,
onFinish: function onFinish() {
tween(labBackground, {
tint: 0xffffff
}, {
duration: 1000
});
}
});
}
}, {
message: "Server crash! Emergency maintenance required.",
effect: function effect() {
funds -= Math.min(funds, 1000 * techLevel);
tween(labBackground, {
tint: 0xe74c3c
}, {
duration: 1000,
onFinish: function onFinish() {
tween(labBackground, {
tint: 0xffffff
}, {
duration: 1000
});
}
});
}
}, {
message: "Industry conference increases visibility!",
effect: function effect() {
reputation += 0.2;
funds += 2000 * techLevel;
}
}, {
message: "AI breakthrough speeds up development!",
effect: function effect() {
for (var i = 0; i < projectCards.length; i++) {
projectCards[i].progress += projectCards[i].timeToComplete * 0.2;
projectCards[i].updateStatus();
}
}
}];
var event = events[Math.floor(Math.random() * events.length)];
var eventText = new Text2(event.message, {
size: 32,
fill: 0xFFFFFF
});
eventText.anchor.set(0.5, 0.5);
eventText.x = 1024;
eventText.y = 1366;
game.addChild(eventText);
tween(eventText, {
y: 1200,
alpha: 0
}, {
duration: 4000,
onFinish: function onFinish() {
eventText.destroy();
}
});
event.effect();
updateUI();
}
// Initialize game
processOfflineProgress();
updateUI();
LK.playMusic('bgMusic');
// Initialize with starting project
LK.setTimeout(function () {
if (projectCards.length === 0) {
startNewProject();
}
}, 1000);
// Save when game is paused
LK.onPause = function () {
saveGameState();
}; ===================================================================
--- original.js
+++ change.js
@@ -221,10 +221,12 @@
researchButton.scaleX = 1.5; // Make it bigger
researchButton.scaleY = 1.5; // Make it bigger
game.addChild(researchButton);
var hireButton = new Button("Hire Developer");
-hireButton.x = 1924; // Move to bottom right
+hireButton.x = 1800; // Move slightly to the left
hireButton.y = 2600; // Adjust vertical position
+hireButton.scaleX = 1.5; // Make it bigger
+hireButton.scaleY = 1.5; // Make it bigger
hireButton.setCost(developerHireCost(developers));
game.addChild(hireButton);
var upgradeLabButton = new Button("Upgrade Lab");
upgradeLabButton.y = 200; // Adjust vertical position
Create a button for hiring employees for an AI buisness. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
An area for testing out AI. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Investment button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Upgrade button. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows