User prompt
Add a button to reset your ending count
User prompt
Add new endings: Quit ending: quit when you see that your roast is ruined and get a job at either Krusty Burger or Jerry's bait shop (each one a different ending); Play Pokemon: play Pokemon on your 3DS while eating lunch with Chalmers. Pee yourself ending: pee yourself when chalmers is suspicious of your actions
User prompt
Add new endings: Loud music ending: play loud music in the entire neighborhood while talking about your old family recipe! Swear ending: swear at superintendent Chalmers in all of the times he's suspicious of you, however, this is highly not recommended. Admit it was from reddit ending: while talking about your old family recipe, you can always admit that it's from reddit (AKA the truth)
User prompt
Add 4 new endings of your choice
User prompt
Make bubblegum ending choice and scammed ending choice visible
User prompt
Add support for 4 endings
User prompt
Make the buttons small enough to fit 2 of them per row
User prompt
Add new endings: Bubblegum ending: eat bubble gum during the luncheon to piss Chalmers off and get fired. Scammed ending: at the start, you can buy roasted beef online, but you will get scammed, causing you to not have enough money to buy fast food. Kill Chalmers: When in the reddit ending, you can actually kill Chalmers if you tap the red button exactly 17 times
User prompt
Allow the Burnt roast ending to activate more than once
User prompt
Increase the chance of the Burnt roast ending to 25% and you can now get it more than once
User prompt
Add new endings: Burnt Roast Ending: there is a 10% chance, instead of making progress, the roast just burns and you get this embarrassing ending. Reddit ending: You say that you learned your recipe from reddit, but chalmers knows nobody can trust redditors, so he fires you. Death ending: you DIE from the FIRE
User prompt
The delightfully devilish ending doesn't give me an ending
User prompt
Then change it to 16
User prompt
Add a button to reset ending count โช๐ก Consider importing and using the following plugins: @upit/storage.v1
User prompt
Make the win condition 14 endings
User prompt
Make the win condition 13 endings
User prompt
Remove the later ending and the Albany ending cause they're impossible to be gotten
User prompt
But they aren't visible
User prompt
Add new endings: Kick out ending (at the start you can kick out chalmers because your roast is ruined!), Fired Ending (if you don't say anything about the smoke, you will definitely get fired), Jerry's bait shop ending (find an Easter egg)
Code edit (1 edits merged)
Please save this source code
User prompt
Steamed Hams: The Choice Game
Initial prompt
Steamed hams: the choice game
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Character = Container.expand(function () { var self = Container.call(this); self.sprite = self.attachAsset('character', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var ChoiceButton = Container.expand(function () { var self = Container.call(this); var button = self.attachAsset('choiceButton', { anchorX: 0.5, anchorY: 0.5 }); self.textObj = new Text2('', { size: 50, fill: 0xFFFFFF }); self.textObj.anchor.set(0.5, 0.5); self.addChild(self.textObj); self.choice = null; self.callback = null; self.setChoice = function (text, choice, callback) { self.textObj.setText(text); self.choice = choice; self.callback = callback; self.alpha = 1; }; self.down = function () { if (self.callback) { self.callback(self.choice); } }; return self; }); var DialogBox = Container.expand(function () { var self = Container.call(this); var box = self.attachAsset('dialogBox', { anchorX: 0.5, anchorY: 0.5 }); self.textObj = new Text2('', { size: 60, fill: 0xFFFFFF }); self.textObj.anchor.set(0.5, 0.5); self.addChild(self.textObj); self.setText = function (text) { self.textObj.setText(text); // Word wrap manually var maxWidth = 1600; var words = text.split(' '); var line = ''; var lines = []; for (var i = 0; i < words.length; i++) { var testLine = line + words[i] + ' '; self.textObj.setText(testLine); if (self.textObj.width > maxWidth) { lines.push(line); line = words[i] + ' '; } else { line = testLine; } } lines.push(line); self.textObj.setText(lines.join('\n')); }; return self; }); var SmokeEffect = Container.expand(function () { var self = Container.call(this); var smoke = self.attachAsset('smoke', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.y -= 2; self.alpha -= 0.01; if (self.alpha <= 0) { self.shouldDestroy = true; } }; return self; }); var Superintendent = Container.expand(function () { var self = Container.call(this); self.sprite = self.attachAsset('superintendent', { anchorX: 0.5, anchorY: 0.5 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ // Story data structure var storyData = { start: { text: "Oh egads! My roast is ruined! But what if I were to purchase fast food and disguise it as my own cooking?", choices: [{ text: "That's a brilliant idea!", next: "kitchen" }, { text: "No, I should tell the truth", next: "truth_ending" }, { text: "Just kick Chalmers out!", next: "kickout_ending" }, { text: "Buy roasted beef online instead", next: "scammed_ending" }, { text: "Quit and work at Krusty Burger", next: "quit_krusty_ending" }, { text: "Quit and work at Jerry's Bait Shop", next: "quit_jerrys_ending" }] }, kitchen: { text: "Superintendent Chalmers arrives! 'SEYMOUR! Why is there smoke coming out of your oven?'", choices: [{ text: "Oh, that isn't smoke, it's steam!", next: "steam" }, { text: "I'm trying a new cooking technique", next: "technique" }, { text: "...", next: "fired_ending" }, { text: "*Chew bubblegum loudly*", next: "bubblegum_ending" }] }, steam: { text: "Steam? Steam from the steamed clams we're having? Mmm, steamed clams!", choices: [{ text: "Yes, steamed clams!", next: "clams" }, { text: "Actually, I said steamed hams", next: "hams" }, { text: "*Put on wizard hat*", next: "wizard_ending" }, { text: "*Swear at Chalmers* (NOT RECOMMENDED)", next: "swear_ending" }, { text: "*Pee yourself from nervousness*", next: "pee_ending" }] }, technique: { text: "A new technique? In the middle of a luncheon?", choices: [{ text: "It's a family recipe", next: "family" }, { text: "I learned it from TV", next: "tv_ending" }, { text: "I learned it from Reddit", next: "reddit_ending" }, { text: "I'm from the future!", next: "time_travel_ending" }] }, clams: { text: "You serve hamburgers. 'These are quite similar to Krusty Burger...'", choices: [{ text: "Oh no, patented Skinner burgers!", next: "patented" }, { text: "Pure coincidence!", next: "coincidence_ending" }, { text: "Actually, they're from Jerry's Bait Shop", next: "jerrys_ending" }] }, hams: { text: "Steamed hams? I thought we were having steamed clams.", choices: [{ text: "It's a regional dialect", next: "dialect" }, { text: "I misspoke earlier", next: "misspoke_ending" }] }, family: { text: "Your mother's recipe?", choices: [{ text: "Yes, an old family recipe", next: "old_recipe" }, { text: "Well, my grandmother's actually", next: "grandmother_ending" }, { text: "Actually... I got it from Reddit", next: "admit_reddit_ending" }] }, dialect: { text: "What region?", choices: [{ text: "Upstate New York", next: "upstate" }, { text: "Albany", next: "albany_ending" }] }, patented: { text: "For steamed hams?", choices: [{ text: "Yes!", next: "success_ending" }, { text: "Despite the fact they're grilled", next: "grilled_ending" }, { text: "*Pull out 3DS and play Pokemon*", next: "pokemon_ending" }] }, old_recipe: { text: "The kitchen suddenly bursts into flames! 'Good Lord, what is happening in there?!'", choices: [{ text: "Aurora Borealis", next: "aurora" }, { text: "Just the oven timer!", next: "timer_ending" }, { text: "Run into the flames!", next: "death_ending" }, { text: "Alien invasion signal!", next: "alien_ending" }, { text: "*Start singing about it*", next: "musical_ending" }, { text: "*BLAST LOUD MUSIC*", next: "loud_music_ending" }] }, upstate: { text: "Really? Well I'm from Utica and I've never heard anyone use the phrase 'steamed hams'", choices: [{ text: "Oh, not in Utica, no. It's an Albany expression", next: "albany_success" }, { text: "You must not get out much", next: "rude_ending" }] }, aurora: { text: "Aurora Borealis?! At this time of year, at this time of day, in this part of the country, localized entirely within your kitchen?!", choices: [{ text: "Yes!", next: "aurora_yes" }, { text: "...No?", next: "aurora_no_ending" }] }, albany_success: { text: "I see. Well, these steamed hams are delicious!", choices: [{ text: "Thank you!", next: "success_ending" }, { text: "Help! The house is on fire!", next: "fire_ending" }] }, aurora_yes: { text: "May I see it?", choices: [{ text: "No.", next: "aurora_final" }, { text: "Maybe later", next: "later_ending" }] }, aurora_final: { text: "Well Seymour, you are an odd fellow, but I must say - you steam a good ham!", choices: [{ text: "Continue", next: "success_ending" }] }, // Endings truth_ending: { text: "You tell Chalmers the truth. He appreciates your honesty and suggests ordering pizza instead. THE END - Honest Ending", choices: [] }, tv_ending: { text: "Chalmers is unimpressed by your TV chef aspirations and leaves. THE END - Failed Impression", choices: [] }, coincidence_ending: { text: "Chalmers doesn't buy it and storms out. THE END - Caught Red-Handed", choices: [] }, misspoke_ending: { text: "Chalmers questions your competence as a principal. THE END - Professional Disaster", choices: [] }, grandmother_ending: { text: "You bond over family recipes and have a pleasant lunch. THE END - Family Connection", choices: [] }, albany_ending: { text: "Chalmers, being from Albany, knows you're lying and leaves disappointed. THE END - Geographic Failure", choices: [] }, grilled_ending: { text: "Your admission ruins the illusion. Chalmers leaves confused. THE END - Unnecessary Honesty", choices: [] }, timer_ending: { text: "The house burns down. THE END - Fire Department Called", choices: [] }, rude_ending: { text: "Chalmers is offended by your rudeness and leaves immediately. THE END - Social Disaster", choices: [] }, aurora_no_ending: { text: "Your uncertainty makes Chalmers suspicious. He investigates and finds the fire. THE END - Caught in Lies", choices: [] }, fire_ending: { text: "You both escape the burning house. Chalmers calls 911. THE END - Emergency Response", choices: [] }, later_ending: { text: "Chalmers grows suspicious of your deflection. THE END - Trust Lost", choices: [] }, success_ending: { text: "Despite everything, the luncheon is a success! Chalmers leaves satisfied. THE END - Delightfully Devilish!", choices: [] }, kickout_ending: { text: "You slam the door in Chalmers' face. 'SKINNER!' he yells from outside. Your career is over but at least you're honest about your cooking. THE END - No Visitors Today", choices: [] }, fired_ending: { text: "You stand there silently as smoke billows out. Chalmers immediately calls the school board. You're fired on the spot for endangerment. THE END - Speechless Disaster", choices: [] }, jerrys_ending: { text: "Chalmers' eyes widen. 'Jerry's Bait Shop? The one by the lake?' You bond over fishing stories and forget all about the lunch. THE END - Gone Fishing", choices: [] }, burnt_ending: { text: "While you were scheming, your roast burned to a crisp! The smoke alarm goes off and Chalmers sees the charred remains. 'SEYMOUR! You've ruined lunch!' THE END - Burnt Roast Disaster", choices: [] }, reddit_ending: { text: "Chalmers frowns deeply. 'Reddit? REDDIT?! Nobody can trust anything from that cesspool of misinformation! You're fired!' THE END - Social Media Failure", choices: [{ text: "Tap the red button", next: "reddit_button" }] }, reddit_button: { text: "You frantically tap a mysterious red button. Chalmers looks confused. 'What are you doing, Seymour?'", choices: [{ text: "Keep tapping the red button", next: "reddit_button" }, { text: "Stop and accept being fired", next: "reddit_ending" }] }, death_ending: { text: "The flames spread too quickly! You are consumed by the fire you created. Chalmers escapes but you... do not. THE END - Fiery Demise", choices: [] }, bubblegum_ending: { text: "You blow a large bubble while Chalmers is speaking. *POP!* 'SEYMOUR! This is highly unprofessional! You're fired!' THE END - Bubblegum Disaster", choices: [] }, scammed_ending: { text: "The online seller disappeared with your money! With no cash left for fast food, you serve Chalmers burnt roast. He's disgusted and fires you immediately. THE END - Online Scam Victim", choices: [] }, kill_chalmers_ending: { text: "In a fit of Reddit-induced rage, you eliminate Chalmers! The authorities arrive shortly after. Your steamed hams remain unfinished. THE END - Homicidal Principal", choices: [] }, wizard_ending: { text: "You put on a wizard hat and declare 'I am a wizard, Chalmers!' He stares in disbelief as you wave a spatula like a wand. 'SEYMOUR! This is highly irregular!' THE END - Magical Principal", choices: [] }, time_travel_ending: { text: "You claim you're from the future where steamed hams are the only food left. Chalmers backs away slowly. 'I'm calling the school psychologist!' THE END - Temporal Displacement", choices: [] }, alien_ending: { text: "You insist the smoke is actually an alien invasion signal. Chalmers looks up nervously. 'Seymour, you need professional help!' THE END - UFO Conspiracy", choices: [] }, musical_ending: { text: "You burst into song about steamed hams! Chalmers is so impressed by your voice that he offers you a recording contract instead of lunch. THE END - Broadway Bound", choices: [] }, loud_music_ending: { text: "You crank up your stereo to maximum volume while shouting about grandma's recipe! The neighbors call the police for noise complaints. Chalmers flees with his hands over his ears. THE END - Noise Violation", choices: [] }, swear_ending: { text: "Your constant swearing throughout the meal shocks Chalmers. 'SEYMOUR! Such language from a principal!' He reports you to the school board immediately. THE END - Profanity Problem", choices: [] }, admit_reddit_ending: { text: "You sheepishly admit you got the recipe from r/cooking. Chalmers laughs heartily. 'At least you're honest, Seymour! Show me the post!' You bond over internet recipes. THE END - Reddit Redemption", choices: [] }, quit_krusty_ending: { text: "You quit being a principal and get a job at Krusty Burger. 'Welcome to Krusty Burger, home of the Krusty Burger, can I take your order?' Your life is simpler now. THE END - Fast Food Career", choices: [] }, quit_jerrys_ending: { text: "You quit being a principal and get a job at Jerry's Bait Shop. The smell of fish and worms becomes your new normal. At least you don't have to cook anymore. THE END - Bait Shop Life", choices: [] }, pokemon_ending: { text: "You pull out your 3DS and start playing Pokemon during lunch. 'SEYMOUR! This is a professional luncheon!' Chalmers is furious at your gaming addiction. THE END - Gotta Catch 'Em All", choices: [] }, pee_ending: { text: "The pressure of Chalmers' suspicious glare causes you to lose control. 'SEYMOUR! Did you just...?!' The superintendent is horrified. Your career is over. THE END - Bladder Failure", choices: [] } }; // Game state var currentScene = "start"; var dialogBox = null; var choiceButtons = []; var skinner = null; var chalmers = null; var smokeEffects = []; var kitchenBg = null; var redButtonTaps = 0; // Initialize kitchen background kitchenBg = game.addChild(LK.getAsset('kitchenBg', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 750 })); // Initialize characters skinner = game.addChild(new Character()); skinner.x = 600; skinner.y = 1000; chalmers = game.addChild(new Superintendent()); chalmers.x = 1400; chalmers.y = 1000; chalmers.alpha = 0; // Initialize dialog box dialogBox = game.addChild(new DialogBox()); dialogBox.x = 1024; dialogBox.y = 2200; // Initialize choice buttons for (var i = 0; i < 6; i++) { var button = game.addChild(new ChoiceButton()); var row = Math.floor(i / 2); var col = i % 2; button.x = 612 + col * 824; // 612 for left column, 1436 for right column button.y = 1600 + row * 140; // Reduced spacing between rows choiceButtons.push(button); } // Score tracking for endings reached var endingsReached = storage.endingsReached || 0; var endingsSeen = storage.endingsSeen || {}; // Score display var scoreText = new Text2('Endings: ' + endingsReached + '/33', { size: 80, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); LK.gui.topRight.addChild(scoreText); scoreText.x = -20; scoreText.y = 20; // Reset button var resetButton = new Text2('Reset Progress', { size: 60, fill: 0xFF4444 }); resetButton.anchor.set(1, 0); LK.gui.topRight.addChild(resetButton); resetButton.x = -20; resetButton.y = 120; // Reset button functionality resetButton.down = function () { // Clear storage endingsReached = 0; endingsSeen = {}; storage.endingsReached = 0; storage.endingsSeen = {}; // Update score display scoreText.setText('Endings: 0/33'); LK.setScore(0); // Flash to indicate reset LK.effects.flashObject(resetButton, 0xFFFFFF, 300); }; function showScene(sceneId) { currentScene = sceneId; var scene = storyData[sceneId]; // Update dialog dialogBox.setText(scene.text); // Show Chalmers after start if (sceneId !== "start" && chalmers.alpha === 0) { tween(chalmers, { alpha: 1 }, { duration: 500 }); } // Hide all choice buttons first for (var i = 0; i < choiceButtons.length; i++) { choiceButtons[i].alpha = 0; } // Show choices for (var j = 0; j < scene.choices.length; j++) { if (j < choiceButtons.length) { // Position buttons in 2 columns var row = Math.floor(j / 2); var col = j % 2; choiceButtons[j].x = 612 + col * 824; // 612 for left column, 1436 for right column choiceButtons[j].y = 1600 + row * 140; // Reduced spacing between rows choiceButtons[j].setChoice(scene.choices[j].text, scene.choices[j].next, handleChoice); tween(choiceButtons[j], { alpha: 1 }, { duration: 300 }); } } // Check if this is an ending if (scene.choices.length === 0) { // This is an ending if (!endingsSeen[sceneId]) { endingsSeen[sceneId] = true; endingsReached++; storage.endingsReached = endingsReached; storage.endingsSeen = endingsSeen; scoreText.setText('Endings: ' + endingsReached + '/33'); LK.setScore(endingsReached); } // Show restart button choiceButtons[0].setChoice("Play Again", "start", handleChoice); tween(choiceButtons[0], { alpha: 1 }, { duration: 300 }); // Check win condition if (endingsReached >= 33) { LK.showYouWin(); } } // Add smoke effects for certain scenes if (sceneId === "kitchen" || sceneId === "old_recipe" || sceneId === "aurora") { createSmoke(); } } function handleChoice(nextScene) { // Track red button taps for kill Chalmers ending if (nextScene === "reddit_button") { redButtonTaps++; if (redButtonTaps >= 17) { showScene("kill_chalmers_ending"); return; } } // Reset counter when leaving reddit scenes if (nextScene !== "reddit_button" && currentScene === "reddit_button") { redButtonTaps = 0; } // 10% chance of burnt roast ending instead of progressing if (nextScene !== "start") { if (Math.random() < 0.1) { showScene("burnt_ending"); return; } } showScene(nextScene); } function createSmoke() { for (var i = 0; i < 3; i++) { var smoke = game.addChild(new SmokeEffect()); smoke.x = 800 + Math.random() * 400; smoke.y = 800; smoke.scaleX = smoke.scaleY = 0.5 + Math.random() * 0.5; smokeEffects.push(smoke); } } // Game update game.update = function () { // Update smoke effects for (var i = smokeEffects.length - 1; i >= 0; i--) { if (smokeEffects[i].shouldDestroy) { smokeEffects[i].destroy(); smokeEffects.splice(i, 1); } } // Occasional smoke generation in fire scenes if ((currentScene === "old_recipe" || currentScene === "aurora") && LK.ticks % 30 === 0) { createSmoke(); } }; // Start the game showScene("start");
===================================================================
--- original.js
+++ change.js
@@ -508,8 +508,30 @@
scoreText.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreText);
scoreText.x = -20;
scoreText.y = 20;
+// Reset button
+var resetButton = new Text2('Reset Progress', {
+ size: 60,
+ fill: 0xFF4444
+});
+resetButton.anchor.set(1, 0);
+LK.gui.topRight.addChild(resetButton);
+resetButton.x = -20;
+resetButton.y = 120;
+// Reset button functionality
+resetButton.down = function () {
+ // Clear storage
+ endingsReached = 0;
+ endingsSeen = {};
+ storage.endingsReached = 0;
+ storage.endingsSeen = {};
+ // Update score display
+ scoreText.setText('Endings: 0/33');
+ LK.setScore(0);
+ // Flash to indicate reset
+ LK.effects.flashObject(resetButton, 0xFFFFFF, 300);
+};
function showScene(sceneId) {
currentScene = sceneId;
var scene = storyData[sceneId];
// Update dialog