User prompt
add stuff in the shop like knifes
User prompt
Make sure there’s a shop button
User prompt
make it so if you win five times then he will say well you’ve did all I needed for you to do now I don’t need you anymore. Do not open up this game anymore and you get a game over and if you restart the game then the tomato will appear, but it’s creepy version and they will say I told you to never come back. I just said never come back you want to break the rules well, I don’t allow rule breakers and then next time you open the game after that there's text saying Dont come back
User prompt
Make it so if you get 5 anger and win with five anger he turns creepy was spinning eyes and he says You fed me but not good enough and jump, scares you leaving you with the same thing with the staring
User prompt
Make it so if you feed the staring thing because he still stays on there when you type in play on the console, and if you feed him, all of the text, just become normal
User prompt
make it so if you somehow press the console button again, you can escape the stair of sequence and you can type in play in the console to restart the game
User prompt
make it so once the Apple appears there’s audio that plays out fast he says so you actually tried to kill me. I’m impressed, but I control this game and then it turns into the staring sequence.
User prompt
make it so the enter isn’t smashed into the backspace
User prompt
make it so as an enter key
User prompt
make the hit box and the text to enter stuff bigger
User prompt
make it so once you click in the black background, then you have a keyboard and if you type in delete, it says it’s deleting files and once it’s almost done, the tomato appears
User prompt
make it so that’s the whole entire background and it takes up all the space of the textures so it’s just texting saying hello user
User prompt
Make sure if you click the console button it brings you to a black box not like a black background with text at the top saying hello user
User prompt
make sure there’s a small button in the top right that says console
User prompt
Make it so the tomato is in front of everything. It’s in front of every layer except the table and food.
User prompt
I still cannot see the tomato
User prompt
I still can’t see the tomato
User prompt
OK, make it so just just a red cube that resembles a tomato
User prompt
Make it so there’s no second foods it’s just a table. It’s just a brown table.
User prompt
OK, add the table with the foods
User prompt
I want you to add that into the game
User prompt
Make it so all the text just get added back along with the background and remove all of the creepy textures. Once you tap his eyes too much.
User prompt
Make it so if you touch his eyes staring into your soul, he blinks and if you do that 10 times he gets irritated and it sends you back to the normal game
User prompt
Make it so that button is a little bit bigger
User prompt
Make it all the text is sealable. It’s like not in black text. It’s in white text.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
creepy: false
});
/****
* Classes
****/
// Food class
var Food = Container.expand(function () {
var self = Container.call(this);
self.foodId = null;
self.isGood = true;
self.isCreepy = false;
self.asset = null;
self.eaten = false;
self.init = function (foodId, isGood, isCreepy) {
self.foodId = foodId;
self.isGood = isGood;
self.isCreepy = isCreepy;
self.asset = self.attachAsset(foodId, {
anchorX: 0.5,
anchorY: 0.5
});
};
// Animate food being eaten
self.eat = function (_onFinish) {
if (self.eaten) return;
self.eaten = true;
tween(self, {
scaleX: 0,
scaleY: 0,
alpha: 0
}, {
duration: 350,
easing: tween.easeIn,
onFinish: function onFinish() {
if (_onFinish) _onFinish();
self.destroy();
}
});
};
// Touch event
self.down = function (x, y, obj) {
if (game.state !== 'playing' && game.state !== 'creepy') return;
game.handleFoodSelect(self);
};
return self;
});
// Tomato class
var Tomato = Container.expand(function () {
var self = Container.call(this);
self.face = null;
self.creepy = false;
self.jumpscare = false;
self.init = function () {
self.face = self.attachAsset('tomatoNormal', {
anchorX: 0.5,
anchorY: 1
});
};
self.setNormal = function () {
self.creepy = false;
self.jumpscare = false;
self.face.assetId = 'tomatoNormal';
self.face.setAsset('tomatoNormal');
};
self.setCreepy = function () {
self.creepy = true;
self.jumpscare = false;
self.face.assetId = 'tomatoCreepy';
self.face.setAsset('tomatoCreepy');
};
self.setJumpscare = function () {
self.jumpscare = true;
self.face.assetId = 'tomatoJumpscare';
self.face.setAsset('tomatoJumpscare');
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xf7e7c1
});
/****
* Game Code
****/
// Music
// Sounds
// Creepy foods
// Bad foods
// Good foods
// Spoon
// Fork
// Plate
// Table
// Tomato (jumpscare)
// Tomato (creepy)
// Tomato (normal)
// --- GLOBALS ---
var tomato = null;
var table = null;
var plate = null;
var utensils = [];
var foodObjs = [];
var foodSlots = [];
var messageTxt = null;
var scoreTxt = null;
var stateTxt = null;
var jumpscareTimeout = null;
var mistakeCount = 0;
var correctCount = 0;
var maxMistakes = 10;
var maxCorrect = 5;
var isJumpscare = false;
var isHaunted = false;
var lastFoodIds = [];
var creepyFoodsFed = 0;
var creepyFoodsNeeded = 3;
var foodY = 2000;
var foodSlotY = 2000;
var foodSlotXStart = 524;
var foodSlotSpacing = 250;
var foodSlotCount = 5;
var foodTypes = [{
id: 'foodApple',
isGood: true,
isCreepy: false
}, {
id: 'foodCheese',
isGood: true,
isCreepy: false
}, {
id: 'foodBread',
isGood: true,
isCreepy: false
}, {
id: 'foodEgg',
isGood: true,
isCreepy: false
}, {
id: 'foodCarrot',
isGood: true,
isCreepy: false
}, {
id: 'foodSoap',
isGood: false,
isCreepy: false
}, {
id: 'foodRock',
isGood: false,
isCreepy: false
}, {
id: 'foodBattery',
isGood: false,
isCreepy: false
}, {
id: 'foodShoe',
isGood: false,
isCreepy: false
}, {
id: 'foodBug',
isGood: false,
isCreepy: false
}];
var creepyFoodTypes = [{
id: 'foodEyeball',
isGood: false,
isCreepy: true
}, {
id: 'foodWorm',
isGood: false,
isCreepy: true
}, {
id: 'foodFingertip',
isGood: false,
isCreepy: true
}, {
id: 'foodTooth',
isGood: false,
isCreepy: true
}, {
id: 'foodHeart',
isGood: false,
isCreepy: true
}];
// --- HAUNTED STATE ---
// Define hauntSecretState at global scope to ensure it always exists
var hauntSecretState = {
phase: 0,
mutationTimeout: null,
mutationInterval: null,
mutated: false,
mutatedTexts: [],
inputSequence: [],
expectedSequence: ['c', 'o', 'n', 's', 'o', 'l', 'e'],
blackRoomContainer: null,
virtualKeyboard: null,
blackRoomInput: "",
blackRoomInputText: null,
blackRoomPrompt: null,
blackRoomEnterBtn: null,
deletingTimeout: null,
deletingStep: 0,
deletingText: null,
deletingSteps: ["Deleting data...", "Deleting sounds...", "Deleting textures...", "Deleting files...", "Deleting files...", "Deleting files..."],
jumpscareTimeout: null,
_lkKeydownListener: null
};
// Haunted state only if jumpscare has occurred (storage.creepy set by jumpscare)
if (storage.creepy === true) {
isHaunted = true;
} else {
isHaunted = false;
}
// --- SETUP SCENE ---
function setupScene() {
// Table
table = LK.getAsset('table', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2200
});
game.addChild(table);
// Plate
plate = LK.getAsset('plate', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 2100
});
game.addChild(plate);
// Utensils
var fork = LK.getAsset('fork', {
anchorX: 0.5,
anchorY: 0.5,
x: 900,
y: 2180
});
var spoon = LK.getAsset('spoon', {
anchorX: 0.5,
anchorY: 0.5,
x: 1150,
y: 2180
});
utensils = [fork, spoon];
game.addChild(fork);
game.addChild(spoon);
// Tomato
tomato = new Tomato();
tomato.init();
tomato.x = 1024;
tomato.y = 900;
game.addChild(tomato);
// Message text
messageTxt = new Text2('', {
size: 90,
fill: 0xffffff
});
messageTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(messageTxt);
// Score text (hidden, but used for state)
scoreTxt = new Text2('0', {
size: 80,
fill: 0xffffff
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.topRight.addChild(scoreTxt);
// State text (for jumpscare/haunt)
stateTxt = new Text2('', {
size: 120,
fill: 0xffffff
});
stateTxt.anchor.set(0.5, 0.5);
LK.gui.center.addChild(stateTxt);
stateTxt.visible = false;
}
// --- GAME STATE ---
game.state = 'init'; // 'init', 'playing', 'creepy', 'jumpscare', 'haunt', 'end'
// --- START GAME ---
function startGame() {
// Reset
mistakeCount = 0;
correctCount = 0;
isJumpscare = false;
creepyFoodsFed = 0;
lastFoodIds = [];
scoreTxt.setText('0');
stateTxt.visible = false;
tomato.setNormal();
game.state = isHaunted ? 'haunt' : 'playing';
if (isHaunted) {
showHaunt();
} else {
showMessage("Help me eat! Feed me the right foods.");
spawnFoods();
LK.playMusic('bgm', {
loop: true
});
}
}
// --- SHOW MESSAGE ---
function showMessage(msg) {
messageTxt.setText(msg);
}
// --- SPAWN FOODS ---
function spawnFoods() {
clearFoods();
foodObjs = [];
foodSlots = [];
var used = {};
var pool = game.state === 'creepy' ? creepyFoodTypes : foodTypes;
// Pick 5 foods, at least 1 correct (if not creepy)
var foods = [];
if (game.state === 'playing') {
// At least 1 good food
var good = [];
var bad = [];
for (var i = 0; i < pool.length; ++i) {
if (pool[i].isGood) good.push(pool[i]);else bad.push(pool[i]);
}
var goodFood = good[Math.floor(Math.random() * good.length)];
foods.push(goodFood);
// Fill rest
while (foods.length < foodSlotCount) {
var arr = Math.random() < 0.5 ? bad : good;
var f = arr[Math.floor(Math.random() * arr.length)];
// Avoid duplicates
var dupe = false;
for (var j = 0; j < foods.length; ++j) if (foods[j].id === f.id) dupe = true;
if (!dupe) foods.push(f);
}
} else {
// Creepy: all from creepyFoodTypes, random
while (foods.length < foodSlotCount) {
var f = pool[Math.floor(Math.random() * pool.length)];
var dupe = false;
for (var j = 0; j < foods.length; ++j) if (foods[j].id === f.id) dupe = true;
if (!dupe) foods.push(f);
}
}
// Shuffle
for (var i = foods.length - 1; i > 0; --i) {
var k = Math.floor(Math.random() * (i + 1));
var tmp = foods[i];
foods[i] = foods[k];
foods[k] = tmp;
}
// Place foods
for (var i = 0; i < foodSlotCount; ++i) {
var slotX = foodSlotXStart + i * foodSlotSpacing;
var food = new Food();
food.init(foods[i].id, foods[i].isGood, foods[i].isCreepy);
food.x = slotX;
food.y = foodSlotY;
food.scaleX = 1;
food.scaleY = 1;
food.alpha = 1;
foodObjs.push(food);
foodSlots.push({
x: slotX,
y: foodSlotY
});
game.addChild(food);
}
}
// --- CLEAR FOODS ---
function clearFoods() {
for (var i = 0; i < foodObjs.length; ++i) {
if (foodObjs[i] && foodObjs[i].destroy) foodObjs[i].destroy();
}
foodObjs = [];
foodSlots = [];
}
// --- HANDLE FOOD SELECT ---
game.handleFoodSelect = function (foodObj) {
if (game.state !== 'playing' && game.state !== 'creepy') return;
if (foodObj.eaten) return;
// Animate food to tomato mouth
var mouthX = tomato.x;
var mouthY = tomato.y - 200;
tween(foodObj, {
x: mouthX,
y: mouthY,
scaleX: 0.3,
scaleY: 0.3,
alpha: 0.7
}, {
duration: 350,
easing: tween.easeIn,
onFinish: function onFinish() {
foodObj.eat();
if (game.state === 'playing') {
if (foodObj.isGood) {
correctCount++;
LK.getSound('eat').play();
LK.effects.flashObject(tomato, 0x9bff4a, 400);
showMessage("Yum! Thank you.");
scoreTxt.setText(correctCount);
if (correctCount >= maxCorrect) {
showMessage("I'm full! See you tomorrow!");
LK.setTimeout(function () {
LK.showYouWin();
}, 1200);
return;
}
} else {
mistakeCount++;
LK.getSound('wrong').play();
LK.effects.flashObject(tomato, 0xff0000, 400);
showMessage("Yuck! That's not food.");
if (mistakeCount >= maxMistakes) {
// Go creepy
LK.getSound('creepy').play();
goCreepy();
return;
}
}
// Next round
LK.setTimeout(function () {
showMessage("Feed me the right foods.");
spawnFoods();
}, 700);
} else if (game.state === 'creepy') {
// Only creepy foods accepted
if (foodObj.isCreepy) {
creepyFoodsFed++;
LK.getSound('eat').play();
LK.effects.flashObject(tomato, 0xff0000, 400);
showMessage("More. Feed me more...");
if (creepyFoodsFed >= creepyFoodsNeeded) {
// Jumpscare
LK.setTimeout(function () {
jumpscare();
}, 700);
return;
}
} else {
LK.getSound('wrong').play();
LK.effects.flashObject(tomato, 0x000000, 400);
showMessage("NO! Give me what I want.");
}
LK.setTimeout(function () {
spawnFoods();
}, 700);
}
}
});
};
// --- GO CREEPY ---
function goCreepy() {
game.state = 'creepy';
tomato.setCreepy();
showMessage("You made me angry. Feed me what I want...");
LK.effects.flashScreen(0x000000, 1200);
LK.setTimeout(function () {
spawnFoods();
}, 1200);
}
// --- JUMPSCARE ---
function jumpscare() {
game.state = 'jumpscare';
isJumpscare = true;
clearFoods();
tomato.setJumpscare();
showMessage("");
stateTxt.setText("👁️");
stateTxt.visible = true;
LK.getSound('jumpscare').play();
LK.effects.flashScreen(0xff0000, 1200);
// Save haunted state
storage.creepy = true;
// After a moment, show game over
jumpscareTimeout = LK.setTimeout(function () {
LK.showGameOver();
}, 1500);
}
// --- SHOW HAUNTED STATE ---
var hauntTextFloodTimeout = null;
var hauntTextFloodInterval = null;
var hauntTextFloods = [];
function showHaunt() {
game.state = 'haunt';
clearFoods();
// Set background to black
game.setBackgroundColor(0x000000);
// Remove all GUI overlays
messageTxt.setText("");
scoreTxt.setText("");
stateTxt.setText("");
stateTxt.visible = false;
// Set tomato to creepy and move to center
tomato.setCreepy();
tomato.x = 1024;
tomato.y = 1366;
// Make tomato's face black-eyed (simulate by overlaying two black ellipses for eyes)
if (!tomato.leftEye) {
tomato.leftEye = LK.getAsset('foodRock', {
anchorX: 0.5,
anchorY: 0.5,
x: -70,
y: -180,
scaleX: 0.7,
scaleY: 1.1
});
tomato.rightEye = LK.getAsset('foodRock', {
anchorX: 0.5,
anchorY: 0.5,
x: 70,
y: -180,
scaleX: 0.7,
scaleY: 1.1
});
tomato.addChild(tomato.leftEye);
tomato.addChild(tomato.rightEye);
}
tomato.leftEye.visible = true;
tomato.rightEye.visible = true;
// --- Eye blink/irritation logic ---
if (typeof window !== "undefined") {
if (!window._creepyEyeBlinkCount) window._creepyEyeBlinkCount = 0;
if (!window._creepyEyeBlinkTimeout) window._creepyEyeBlinkTimeout = null;
}
if (typeof tomato._creepyEyeBlinkCount === "undefined") tomato._creepyEyeBlinkCount = 0;
if (typeof tomato._creepyEyeBlinkTimeout === "undefined") tomato._creepyEyeBlinkTimeout = null;
// Helper to blink both eyes
function blinkEyes() {
tomato.leftEye.visible = false;
tomato.rightEye.visible = false;
if (tomato._creepyEyeBlinkTimeout) LK.clearTimeout(tomato._creepyEyeBlinkTimeout);
tomato._creepyEyeBlinkTimeout = LK.setTimeout(function () {
tomato.leftEye.visible = true;
tomato.rightEye.visible = true;
tomato._creepyEyeBlinkTimeout = null;
}, 220);
}
// Helper to reset irritation
function resetIrritation() {
tomato._creepyEyeBlinkCount = 0;
}
// Add .down event to both eyes
tomato.leftEye.down = function (x, y, obj) {
blinkEyes();
tomato._creepyEyeBlinkCount++;
if (tomato._creepyEyeBlinkCount >= 10) {
// Irritated: send back to normal game
tomato._creepyEyeBlinkCount = 0;
if (typeof window !== "undefined") window._creepyEyeBlinkCount = 0;
// Remove eyes
tomato.leftEye.visible = false;
tomato.rightEye.visible = false;
// Reset haunted state and return to normal game
isHaunted = false;
storage.creepy = false;
// Restore all text and background, remove creepy textures
// Show all GUI overlays and restore background
if (table) table.visible = true;
if (plate) plate.visible = true;
for (var i = 0; i < utensils.length; ++i) {
if (utensils[i]) utensils[i].visible = true;
}
if (messageTxt) {
messageTxt.visible = true;
messageTxt.setText("Help me eat! Feed me the right foods.");
}
if (scoreTxt) {
scoreTxt.visible = true;
scoreTxt.setText("0");
}
if (stateTxt) {
stateTxt.visible = false;
stateTxt.setText("");
}
// Restore background color
game.setBackgroundColor(0xf7e7c1);
// Set tomato to normal
if (tomato && tomato.setNormal) tomato.setNormal();
// Remove any creepy/jumpscare overlays
// Remove all haunt text floods
if (typeof hauntTextFloods !== "undefined") {
for (var i = 0; i < hauntTextFloods.length; ++i) {
if (hauntTextFloods[i] && hauntTextFloods[i].destroy) hauntTextFloods[i].destroy();
}
hauntTextFloods = [];
}
// Remove black room container if present
if (typeof hauntSecretState !== "undefined" && hauntSecretState.blackRoomContainer && hauntSecretState.blackRoomContainer.destroy) {
hauntSecretState.blackRoomContainer.destroy();
hauntSecretState.blackRoomContainer = null;
}
// Remove console button if present
if (typeof consoleBtn !== "undefined" && consoleBtn && consoleBtn.destroy) {
consoleBtn.destroy();
consoleBtn = null;
}
// Remove any jumpscare overlays
if (typeof jumpscareC !== "undefined" && jumpscareC && jumpscareC.destroy) {
jumpscareC.destroy();
jumpscareC = null;
}
// Show start menu after a short delay
LK.setTimeout(function () {
showStartMenu();
}, 600);
}
};
tomato.rightEye.down = tomato.leftEye.down;
// Hide table, plate, utensils
if (table) table.visible = false;
if (plate) plate.visible = false;
for (var i = 0; i < utensils.length; ++i) {
if (utensils[i]) utensils[i].visible = false;
}
// Remove all GUI overlays and text, just the tomato staring
messageTxt.visible = false;
scoreTxt.visible = false;
stateTxt.visible = false;
// Reset irritation blink count when entering stare
if (typeof tomato._creepyEyeBlinkCount !== "undefined") tomato._creepyEyeBlinkCount = 0;
if (typeof window !== "undefined") window._creepyEyeBlinkCount = 0;
// --- Console button in creepy stare ---
if (typeof consoleBtn !== "undefined" && consoleBtn && consoleBtn.destroy) {
consoleBtn.destroy();
consoleBtn = null;
}
consoleBtn = new Text2("console", {
size: 80,
fill: 0xffffff
});
consoleBtn.anchor.set(0.5, 0.5);
consoleBtn.x = 2048 - 80;
consoleBtn.y = 80;
consoleBtn.down = function (x, y, obj) {
// Simulate the secret input sequence to enter the console/black room
if (typeof hauntSecretState !== "undefined" && typeof enterBlackRoom === "function") {
hauntSecretState.phase = 2;
if (hauntSecretState._lkKeydownListener) {
LK.off('keydown', hauntSecretState._lkKeydownListener);
hauntSecretState._lkKeydownListener = null;
}
enterBlackRoom();
}
};
LK.gui.topRight.addChild(consoleBtn);
// Remove any previous haunt text floods
if (hauntTextFloodTimeout) {
LK.clearTimeout(hauntTextFloodTimeout);
hauntTextFloodTimeout = null;
}
if (hauntTextFloodInterval) {
LK.clearInterval(hauntTextFloodInterval);
hauntTextFloodInterval = null;
}
for (var i = 0; i < hauntTextFloods.length; ++i) {
if (hauntTextFloods[i] && hauntTextFloods[i].destroy) hauntTextFloods[i].destroy();
}
hauntTextFloods = [];
// --- HAUNTED SECRET STATE LOGIC ---
var hauntSecretState = {
phase: 0,
// 0: normal, 1: mutated, 2: inputting, 3: black room, 4: deleting, 5: jumpscare
mutationTimeout: null,
mutationInterval: null,
mutated: false,
mutatedTexts: [],
inputSequence: [],
expectedSequence: ['c', 'o', 'n', 's', 'o', 'l', 'e'],
blackRoomContainer: null,
virtualKeyboard: null,
blackRoomInput: "",
blackRoomInputText: null,
blackRoomPrompt: null,
blackRoomEnterBtn: null,
deletingTimeout: null,
deletingStep: 0,
deletingText: null,
deletingSteps: ["Deleting data...", "Deleting sounds...", "Deleting textures...", "Deleting files...", "Deleting files...", "Deleting files..."],
jumpscareTimeout: null
};
// After a few seconds, start flooding the screen with "You don't own this game"
hauntTextFloodTimeout = LK.setTimeout(function () {
var floodCount = 0;
hauntTextFloodInterval = LK.setInterval(function () {
// Each interval, add more and more text
var numToAdd = 3 + Math.floor(floodCount / 2);
for (var j = 0; j < numToAdd; ++j) {
var txt = new Text2("You don't own this game", {
size: 90 + Math.floor(Math.random() * 40),
fill: 0xffffff
});
txt.anchor.set(0.5, 0.5);
// Random position, but not overlapping the top left 100x100
var minX = 120,
minY = 120,
maxX = 2048 - 120,
maxY = 2732 - 120;
txt.x = minX + Math.random() * (maxX - minX);
txt.y = minY + Math.random() * (maxY - minY);
LK.gui.center.addChild(txt);
hauntTextFloods.push(txt);
}
floodCount++;
// After 7 intervals, mutate the text
if (!hauntSecretState.mutated && floodCount >= 7) {
hauntSecretState.mutated = true;
for (var i = 0; i < hauntTextFloods.length; ++i) {
if (hauntTextFloods[i] && hauntTextFloods[i].setText) {
hauntTextFloods[i].setText("yoc don't own this gome l e");
}
}
// Start listening for secret input
hauntSecretState.phase = 1;
hauntSecretState.inputSequence = [];
// Add a global keydown listener for the secret sequence using LK.on
if (!hauntSecretState._lkKeydownListener) {
hauntSecretState._lkKeydownListener = function (obj) {
if (obj && obj.event && obj.event.key) {
hauntSecretKeyListener(obj.event);
}
};
LK.on('keydown', hauntSecretState._lkKeydownListener);
}
}
}, 1800);
}, 3500);
// Secret input handler for "console" sequence
function hauntSecretKeyListener(e) {
if (hauntSecretState.phase !== 1) return;
var key = e.key ? e.key.toLowerCase() : "";
if (!key.match(/^[a-z]$/)) return;
var seq = hauntSecretState.inputSequence;
var expected = hauntSecretState.expectedSequence;
if (key === expected[seq.length]) {
seq.push(key);
if (seq.length === expected.length) {
// Success! Go to black room
hauntSecretState.phase = 2;
if (hauntSecretState._lkKeydownListener) {
LK.off('keydown', hauntSecretState._lkKeydownListener);
hauntSecretState._lkKeydownListener = null;
}
enterBlackRoom();
}
} else {
// Reset if wrong
hauntSecretState.inputSequence = [];
}
}
// Black room with virtual keyboard
function enterBlackRoom() {
// Remove all haunt text
for (var i = 0; i < hauntTextFloods.length; ++i) {
if (hauntTextFloods[i] && hauntTextFloods[i].destroy) hauntTextFloods[i].destroy();
}
hauntTextFloods = [];
if (hauntSecretState.blackRoomContainer && hauntSecretState.blackRoomContainer.destroy) {
hauntSecretState.blackRoomContainer.destroy();
}
var c = new Container();
hauntSecretState.blackRoomContainer = c;
// Black background
game.setBackgroundColor(0x000000);
// Hi user text
var hiTxt = new Text2("Hi user", {
size: 160,
fill: 0xffffff
});
hiTxt.anchor.set(0.5, 0.5);
hiTxt.x = 1024;
hiTxt.y = 600;
c.addChild(hiTxt);
// Prompt
var prompt = new Text2("Type in the console below:", {
size: 80,
fill: 0xffffff
});
prompt.anchor.set(0.5, 0.5);
prompt.x = 1024;
prompt.y = 900;
c.addChild(prompt);
hauntSecretState.blackRoomPrompt = prompt;
// Input text
var inputTxt = new Text2("", {
size: 100,
fill: 0x00ff00
});
inputTxt.anchor.set(0.5, 0.5);
inputTxt.x = 1024;
inputTxt.y = 1100;
c.addChild(inputTxt);
hauntSecretState.blackRoomInputText = inputTxt;
hauntSecretState.blackRoomInput = "";
// Virtual keyboard
createVirtualKeyboard(c, inputTxt);
// Enter button
var enterBtn = new Text2("Enter", {
size: 90,
fill: 0xffffff
});
enterBtn.anchor.set(0.5, 0.5);
enterBtn.x = 1700;
enterBtn.y = 1800;
enterBtn.down = function () {
handleBlackRoomEnter();
};
c.addChild(enterBtn);
hauntSecretState.blackRoomEnterBtn = enterBtn;
// Add to game
game.addChild(c);
}
// Virtual keyboard (letters a-z, delete, space)
function createVirtualKeyboard(container, inputTxt) {
if (hauntSecretState.virtualKeyboard && hauntSecretState.virtualKeyboard.destroy) {
hauntSecretState.virtualKeyboard.destroy();
}
var kb = new Container();
var keys = [['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'], ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'], ['z', 'x', 'c', 'v', 'b', 'n', 'm'], ['delete', 'space']];
var startY = 1300;
var keyW = 160,
keyH = 120,
gap = 20;
for (var row = 0; row < keys.length; ++row) {
var rowKeys = keys[row];
var rowY = startY + row * (keyH + gap);
var rowLen = rowKeys.length;
var totalW = rowLen * keyW + (rowLen - 1) * gap;
var startX = 1024 - totalW / 2 + keyW / 2;
for (var col = 0; col < rowKeys.length; ++col) {
var k = rowKeys[col];
var keyBtn = new Text2(k === "space" ? " " : k.toUpperCase(), {
size: 70,
fill: k === "delete" ? 0xff0000 : 0xffffff
});
keyBtn.anchor.set(0.5, 0.5);
keyBtn.x = startX + col * (keyW + gap);
keyBtn.y = rowY;
keyBtn.down = function (k) {
return function () {
if (k === "delete") {
hauntSecretState.blackRoomInput = hauntSecretState.blackRoomInput.slice(0, -1);
} else if (k === "space") {
hauntSecretState.blackRoomInput += " ";
} else {
hauntSecretState.blackRoomInput += k;
}
inputTxt.setText(hauntSecretState.blackRoomInput);
};
}(k);
kb.addChild(keyBtn);
}
}
container.addChild(kb);
hauntSecretState.virtualKeyboard = kb;
}
// Handle enter in black room
function handleBlackRoomEnter() {
var val = hauntSecretState.blackRoomInput.trim().toLowerCase();
if (val === "delete") {
// Start deleting sequence
startDeletingSequence();
} else {
// Show error
if (hauntSecretState.blackRoomPrompt && hauntSecretState.blackRoomPrompt.setText) {
hauntSecretState.blackRoomPrompt.setText("Unknown command.");
}
}
}
// Deleting sequence
function startDeletingSequence() {
hauntSecretState.phase = 4;
// Remove keyboard and enter button
if (hauntSecretState.virtualKeyboard && hauntSecretState.virtualKeyboard.destroy) {
hauntSecretState.virtualKeyboard.destroy();
hauntSecretState.virtualKeyboard = null;
}
if (hauntSecretState.blackRoomEnterBtn && hauntSecretState.blackRoomEnterBtn.destroy) {
hauntSecretState.blackRoomEnterBtn.destroy();
hauntSecretState.blackRoomEnterBtn = null;
}
if (hauntSecretState.blackRoomPrompt && hauntSecretState.blackRoomPrompt.setText) {
hauntSecretState.blackRoomPrompt.setText("");
}
if (hauntSecretState.blackRoomInputText && hauntSecretState.blackRoomInputText.setText) {
hauntSecretState.blackRoomInputText.setText("");
}
// Add deleting text
var delTxt = new Text2("", {
size: 100,
fill: 0xff0000
});
delTxt.anchor.set(0.5, 0.5);
delTxt.x = 1024;
delTxt.y = 1500;
hauntSecretState.blackRoomContainer.addChild(delTxt);
hauntSecretState.deletingText = delTxt;
hauntSecretState.deletingStep = 0;
doDeletingStep();
}
// Animate deleting steps
function doDeletingStep() {
if (hauntSecretState.deletingStep < hauntSecretState.deletingSteps.length) {
hauntSecretState.deletingText.setText(hauntSecretState.deletingSteps[hauntSecretState.deletingStep]);
hauntSecretState.deletingStep++;
hauntSecretState.deletingTimeout = LK.setTimeout(doDeletingStep, 1200);
} else {
// After a pause, jumpscare
hauntSecretState.deletingText.setText("...");
hauntSecretState.jumpscareTimeout = LK.setTimeout(function () {
showJumpscareFromBlackRoom();
}, 1200);
}
}
// Jumpscare from black room
function showJumpscareFromBlackRoom() {
if (hauntSecretState.blackRoomContainer && hauntSecretState.blackRoomContainer.destroy) {
hauntSecretState.blackRoomContainer.destroy();
hauntSecretState.blackRoomContainer = null;
}
// Show creepy tomato and text
var jumpscareC = new Container();
var t = LK.getAsset('tomatoJumpscare', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366
});
jumpscareC.addChild(t);
var txt = new Text2("wow you've actually tried to defeat me\nwell too bad. I have control over this game", {
size: 90,
fill: 0xffffff
});
txt.anchor.set(0.5, 0.5);
txt.x = 1024;
txt.y = 2100;
jumpscareC.addChild(txt);
game.addChild(jumpscareC);
LK.getSound('jumpscare').play();
LK.effects.flashScreen(0xff0000, 1200);
// After a moment, return to haunted tomato stare
LK.setTimeout(function () {
if (jumpscareC && jumpscareC.destroy) jumpscareC.destroy();
// Show tomato staring into your soul
showHaunt();
}, 3200);
}
}
// --- START MENU ---
var startMenu = null;
var stockMenuBtn = null;
var stockMenu = null;
var inStockMenu = false;
function showStartMenu() {
// If haunted, do not show start menu, just showHaunt (and hide any stock menu button)
if (isHaunted) {
hideStockMenuButton && hideStockMenuButton();
showHaunt();
return;
}
game.state = 'startmenu';
// Hide all game elements
if (table) table.visible = false;
if (plate) plate.visible = false;
for (var i = 0; i < utensils.length; ++i) {
if (utensils[i]) utensils[i].visible = false;
}
if (tomato) tomato.visible = false;
if (messageTxt) messageTxt.visible = false;
if (scoreTxt) scoreTxt.visible = false;
if (stateTxt) stateTxt.visible = false;
clearFoods();
// Remove previous menu if any
if (startMenu && startMenu.destroy) startMenu.destroy();
startMenu = new Container();
// Title
var title = new Text2("Tomato Feast", {
size: 180,
fill: 0xffffff
});
title.anchor.set(0.5, 0.5);
title.x = 1024;
title.y = 700;
startMenu.addChild(title);
// Start button
var startBtn = new Text2("Start", {
size: 120,
fill: 0xffffff
});
startBtn.anchor.set(0.5, 0.5);
startBtn.x = 1024;
startBtn.y = 1200;
startMenu.addChild(startBtn);
// Stock menu button
var stockBtn = new Text2("Stock Menu", {
size: 90,
fill: 0xffffff
});
stockBtn.anchor.set(0.5, 0.5);
stockBtn.x = 1024;
stockBtn.y = 1400;
startMenu.addChild(stockBtn);
// Button events
startBtn.down = function (x, y, obj) {
if (startMenu && startMenu.destroy) startMenu.destroy();
startMenu = null;
startGame();
};
stockBtn.down = function (x, y, obj) {
showStockMenu();
};
game.addChild(startMenu);
}
function showStockMenu() {
inStockMenu = true;
// Remove previous stock menu if any
if (stockMenu && stockMenu.destroy) stockMenu.destroy();
if (startMenu && startMenu.destroy) startMenu.destroy();
stockMenu = new Container();
// Title
var stockTitle = new Text2("Stock Menu", {
size: 140,
fill: 0xffffff
});
stockTitle.anchor.set(0.5, 0.5);
stockTitle.x = 1024;
stockTitle.y = 700;
stockMenu.addChild(stockTitle);
// List all food types
var yStart = 900;
var yStep = 120;
for (var i = 0; i < foodTypes.length; ++i) {
var f = foodTypes[i];
var txt = new Text2(f.id.replace('food', ''), {
size: 70,
fill: 0xffffff
});
txt.anchor.set(0, 0.5);
txt.x = 700;
txt.y = yStart + i * yStep;
stockMenu.addChild(txt);
var icon = LK.getAsset(f.id, {
anchorX: 0.5,
anchorY: 0.5,
x: 600,
y: yStart + i * yStep
});
stockMenu.addChild(icon);
}
// Creepy foods
for (var j = 0; j < creepyFoodTypes.length; ++j) {
var f2 = creepyFoodTypes[j];
var txt2 = new Text2(f2.id.replace('food', ''), {
size: 70,
fill: 0xffffff
});
txt2.anchor.set(0, 0.5);
txt2.x = 700;
txt2.y = yStart + (foodTypes.length + j) * yStep;
stockMenu.addChild(txt2);
var icon2 = LK.getAsset(f2.id, {
anchorX: 0.5,
anchorY: 0.5,
x: 600,
y: yStart + (foodTypes.length + j) * yStep
});
stockMenu.addChild(icon2);
}
// Back button
var backBtn = new Text2("Back", {
size: 100,
fill: 0xffffff
});
backBtn.anchor.set(0.5, 0.5);
backBtn.x = 1024;
backBtn.y = 2200;
stockMenu.addChild(backBtn);
backBtn.down = function (x, y, obj) {
if (stockMenu && stockMenu.destroy) stockMenu.destroy();
stockMenu = null;
inStockMenu = false;
showStartMenu();
};
game.addChild(stockMenu);
}
// Add stock menu button in normal game
function showStockMenuButton() {
// If haunted, never show the stock menu button
if (isHaunted) {
if (stockMenuBtn && stockMenuBtn.destroy) stockMenuBtn.destroy();
stockMenuBtn = null;
return;
}
if (stockMenuBtn && stockMenuBtn.destroy) stockMenuBtn.destroy();
stockMenuBtn = new Text2("Stock Menu", {
size: 70,
fill: 0x666666
});
stockMenuBtn.anchor.set(0.5, 0.5);
stockMenuBtn.x = 2048 - 200;
stockMenuBtn.y = 200;
stockMenuBtn.down = function (x, y, obj) {
showStockMenu();
};
LK.gui.topRight.addChild(stockMenuBtn);
}
// Remove stock menu button
function hideStockMenuButton() {
if (stockMenuBtn && stockMenuBtn.destroy) {
stockMenuBtn.destroy();
stockMenuBtn = null;
}
}
// --- GAME INIT ---
setupScene();
showStartMenu();
// --- TESTING: Add a button to return to the game at any time ---
var testReturnBtn = null;
var testerBtn = null;
var consoleBtn = null; // New: console button
// Set window.TESTER to true only for user his123
if (typeof window !== "undefined") {
window.TESTER = window.USER && window.USER === "his123" || typeof window.USERNAME !== "undefined" && window.USERNAME === "his123";
}
function showTestReturnBtn() {
// Only show if in test mode (set window.TEST_MODE = true in dev tools)
if (typeof window !== "undefined" && window.TEST_MODE) {
if (testReturnBtn && testReturnBtn.destroy) testReturnBtn.destroy();
testReturnBtn = new Text2("Return to Game", {
size: 60,
fill: 0x00aaff
});
testReturnBtn.anchor.set(0.5, 0.5);
testReturnBtn.x = 2048 - 200;
testReturnBtn.y = 300;
testReturnBtn.down = function (x, y, obj) {
// Always start the game, even if haunted
if (startMenu && startMenu.destroy) startMenu.destroy();
if (stockMenu && stockMenu.destroy) stockMenu.destroy();
startGame();
};
LK.gui.topRight.addChild(testReturnBtn);
} else {
if (testReturnBtn && testReturnBtn.destroy) {
testReturnBtn.destroy();
testReturnBtn = null;
}
}
// Tester-only button
if (typeof window !== "undefined" && window.TESTER) {
if (testerBtn && testerBtn.destroy) testerBtn.destroy();
testerBtn = new Text2("Tester Button", {
size: 60,
fill: 0xff00ff
});
testerBtn.anchor.set(0.5, 0.5);
testerBtn.x = 2048 - 200;
testerBtn.y = 400;
testerBtn.down = function (x, y, obj) {
// Example: show a message or perform a tester-only action
showMessage("Tester button pressed!");
};
LK.gui.topRight.addChild(testerBtn);
} else {
if (testerBtn && testerBtn.destroy) {
testerBtn.destroy();
testerBtn = null;
}
}
// --- Console button ---
if (consoleBtn && consoleBtn.destroy) {
consoleBtn.destroy();
consoleBtn = null;
}
// Only show console button if not haunted and not already in console/black room
if (!isHaunted && (!hauntSecretState || hauntSecretState.phase !== 2)) {
consoleBtn = new Text2("console", {
size: 80,
fill: 0xffffff
});
consoleBtn.anchor.set(0.5, 0.5);
consoleBtn.x = 2048 - 80;
consoleBtn.y = 80;
consoleBtn.down = function (x, y, obj) {
// Simulate the secret input sequence to enter the console/black room
if (typeof hauntSecretState !== "undefined" && typeof enterBlackRoom === "function") {
hauntSecretState.phase = 2;
if (hauntSecretState._lkKeydownListener) {
LK.off('keydown', hauntSecretState._lkKeydownListener);
hauntSecretState._lkKeydownListener = null;
}
enterBlackRoom();
}
};
LK.gui.topRight.addChild(consoleBtn);
}
}
// Call on init and after menus
showTestReturnBtn();
// Patch startGame to show/hide stock menu button
var _originalStartGame = startGame;
startGame = function startGame() {
hideStockMenuButton();
_originalStartGame();
if (!isHaunted) showStockMenuButton();
showTestReturnBtn();
};
// --- GAME EVENTS ---
game.update = function () {
// No per-frame logic needed for this game
};
game.down = function (x, y, obj) {
// No drag, but allow food selection
// (handled by Food.down)
};
game.move = function (x, y, obj) {
// No drag
};
game.up = function (x, y, obj) {
// No drag
};
// --- RESET ON GAME OVER ---
LK.on('gameover', function () {
// If haunted, clear haunted state on game over (unless jumpscare happens again)
if (storage.creepy === true) {
storage.creepy = false;
}
});
// --- WIN HANDLER ---
LK.on('youwin', function () {
// If haunted, clear haunted state on win (unless jumpscare happens again)
if (storage.creepy === true) {
storage.creepy = false;
}
});
// --- MUSIC ---
LK.playMusic('bgm', {
loop: true
}); ===================================================================
--- original.js
+++ change.js
@@ -559,9 +559,55 @@
tomato.rightEye.visible = false;
// Reset haunted state and return to normal game
isHaunted = false;
storage.creepy = false;
- showMessage("...");
+ // Restore all text and background, remove creepy textures
+ // Show all GUI overlays and restore background
+ if (table) table.visible = true;
+ if (plate) plate.visible = true;
+ for (var i = 0; i < utensils.length; ++i) {
+ if (utensils[i]) utensils[i].visible = true;
+ }
+ if (messageTxt) {
+ messageTxt.visible = true;
+ messageTxt.setText("Help me eat! Feed me the right foods.");
+ }
+ if (scoreTxt) {
+ scoreTxt.visible = true;
+ scoreTxt.setText("0");
+ }
+ if (stateTxt) {
+ stateTxt.visible = false;
+ stateTxt.setText("");
+ }
+ // Restore background color
+ game.setBackgroundColor(0xf7e7c1);
+ // Set tomato to normal
+ if (tomato && tomato.setNormal) tomato.setNormal();
+ // Remove any creepy/jumpscare overlays
+ // Remove all haunt text floods
+ if (typeof hauntTextFloods !== "undefined") {
+ for (var i = 0; i < hauntTextFloods.length; ++i) {
+ if (hauntTextFloods[i] && hauntTextFloods[i].destroy) hauntTextFloods[i].destroy();
+ }
+ hauntTextFloods = [];
+ }
+ // Remove black room container if present
+ if (typeof hauntSecretState !== "undefined" && hauntSecretState.blackRoomContainer && hauntSecretState.blackRoomContainer.destroy) {
+ hauntSecretState.blackRoomContainer.destroy();
+ hauntSecretState.blackRoomContainer = null;
+ }
+ // Remove console button if present
+ if (typeof consoleBtn !== "undefined" && consoleBtn && consoleBtn.destroy) {
+ consoleBtn.destroy();
+ consoleBtn = null;
+ }
+ // Remove any jumpscare overlays
+ if (typeof jumpscareC !== "undefined" && jumpscareC && jumpscareC.destroy) {
+ jumpscareC.destroy();
+ jumpscareC = null;
+ }
+ // Show start menu after a short delay
LK.setTimeout(function () {
showStartMenu();
}, 600);
}
Modern App Store icon, high definition, square with rounded corners, for a game titled "Feed the Tomato: The Hungry Return" and with the description "Help a tomato eat by choosing the right foods. Too many mistakes turn it creepy, leading to a jumpscare and a haunting return.". No text on icon!
Apple. In-Game asset. 2d. High contrast. No shadows
bratery. In-Game asset. 2d. High contrast. No shadows
Bread. In-Game asset. 2d. High contrast. No shadows
cheese. In-Game asset. 2d. High contrast. No shadows
Bug. In-Game asset. 2d. High contrast. No shadows
Egg. In-Game asset. 2d. High contrast. No shadows
Eyeball. In-Game asset. 2d. High contrast. No shadows
Fingertip. In-Game asset. 2d. High contrast. No shadows
A real heart. In-Game asset. 2d. High contrast. No shadows
Rock. In-Game asset. 2d. High contrast. No shadows
Shoe. In-Game asset. 2d. High contrast. No shadows
Tooth. In-Game asset. 2d. High contrast. No shadows
Plate. In-Game asset. 2d. High contrast. No shadows
Soap. In-Game asset. 2d. High contrast. No shadows
Fork. In-Game asset. 2d. High contrast. No shadows
Carrot. In-Game asset. 2d. High contrast. No shadows
Worm. In-Game asset. 2d. High contrast. No shadows
tomato with eyes. In-Game asset. 2d. High contrast. No shadows
Error. In-Game asset. 2d. High contrast. No shadows