User prompt
just tap to play on the start screen and nothing else
User prompt
make the start screen more beautiful
User prompt
make the start screen more beautiful
User prompt
delete calluses playable, leave only the play button
User prompt
add start and how to play screen
User prompt
higher the question a little
User prompt
lower the question a little
User prompt
Enlarge the question a little
User prompt
make score and round black
User prompt
open up the answers a little bit
User prompt
a little lower
User prompt
a little lower
User prompt
narrow the space between answers and write lower
User prompt
write the question in black
User prompt
add background as assets
User prompt
I gave the wrong order, take it back
User prompt
I gave the wrong order, take it back
User prompt
take it back
User prompt
narrow the range of questions very slightly and move them down more
User prompt
space the answers more and move them down a bit, make the question bigger and move it down a bit.
User prompt
write the question in black
User prompt
add background as assets
User prompt
write a total of 30 questions and ask the player 10 of these 30 questions at random
User prompt
add background music
User prompt
move score and round to bottom left and bottom right
/**** * Classes ****/ // No plugins needed for MVP // AnswerButton: A selectable answer option var AnswerButton = Container.expand(function () { var self = Container.call(this); // Default state self.state = 'default'; // 'default', 'selected', 'correct', 'wrong' self.index = 0; // 0,1,2 // Attach default button asset var btn = self.attachAsset('answerBtn', { anchorX: 0.5, anchorY: 0.5 }); // Attach answer text self.txt = new Text2('', { size: 80, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 1500, align: 'center' }); self.txt.anchor.set(0.5, 0.5); self.txt.x = 0; self.txt.y = 0; self.addChild(self.txt); // Set answer text self.setText = function (str) { self.txt.setText(str); }; // Set state: 'default', 'selected', 'correct', 'wrong' self.setState = function (state) { self.state = state; if (state === 'default') { btn.assetId = 'answerBtn'; } else if (state === 'selected') { btn.assetId = 'answerBtnSelected'; } else if (state === 'correct') { btn.assetId = 'answerBtnCorrect'; } else if (state === 'wrong') { btn.assetId = 'answerBtnWrong'; } // Swap asset self.removeChild(btn); btn = self.attachAsset(btn.assetId, { anchorX: 0.5, anchorY: 0.5 }); self.setChildIndex(btn, 0); }; // Down event (touch/click) self.down = function (x, y, obj) { if (typeof self.onSelect === 'function') { self.onSelect(self.index); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181c24 }); /**** * Game Code ****/ // Shapes for answer buttons // --- DATA: 10 rounds, each with 3 statements (2 true, 1 lie) --- // Each round: { statements: [str, str, str], lie: index } var rounds = [{ statements: ["The heart of a shrimp is located in its head.", "Venus is the closest planet to the Sun.", "Bananas grow on plants that are technically herbs."], lie: 1 }, { statements: ["Honey never spoils and can last thousands of years.", "The Great Wall of China is visible from the Moon.", "Octopuses have three hearts."], lie: 1 }, { statements: ["A group of crows is called a murder.", "Humans and dinosaurs coexisted.", "The Eiffel Tower can be 15 cm taller during hot days."], lie: 1 }, { statements: ["Lightning can strike the same place twice.", "Goldfish only have a memory of three seconds.", "The unicorn is the national animal of Scotland."], lie: 1 }, { statements: ["There are more stars in the universe than grains of sand on Earth.", "Bats are blind.", "Some turtles can breathe through their butts."], lie: 1 }, { statements: ["The human nose can detect over 1 trillion smells.", "Mount Everest is the tallest mountain above sea level.", "Penguins can fly short distances."], lie: 2 }, { statements: ["The inventor of the lightbulb was Thomas Edison.", "A snail can sleep for three years.", "The Statue of Liberty was a gift from France."], lie: 0 }, { statements: ["The Amazon is the longest river in the world.", "Some metals are so reactive that they explode on contact with water.", "The fingerprints of a koala are so similar to humans that they can taint crime scenes."], lie: 0 }, { statements: ["The human body has four lungs.", "The Mona Lisa has no eyebrows.", "The speed of light is faster than the speed of sound."], lie: 0 }, { statements: ["The largest desert in the world is the Sahara.", "The tongue is the strongest muscle in the human body.", "A bolt of lightning contains enough energy to toast 100,000 slices of bread."], lie: 1 }]; // Shuffle rounds for replayability function shuffleArray(arr) { for (var i = arr.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } shuffleArray(rounds); // --- GAME STATE --- var currentRound = 0; var score = 0; var selectedIndex = -1; var locked = false; // Prevent multiple answers var answerButtons = []; var questionText = null; var roundText = null; var scoreText = null; // --- GUI SETUP --- // Score display (bottom left) scoreText = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreText.anchor.set(0, 1); scoreText.x = 60; scoreText.y = LK.gui.bottom.height - 30; LK.gui.bottomLeft.addChild(scoreText); // Round display (bottom right) roundText = new Text2('Round 1/10', { size: 80, fill: 0xFFFFFF }); roundText.anchor.set(1, 1); roundText.x = LK.gui.bottom.width - 60; roundText.y = LK.gui.bottom.height - 30; LK.gui.bottomRight.addChild(roundText); // Question text (centered, above answers) questionText = new Text2('', { size: 90, fill: 0xFFFBE6, wordWrap: true, wordWrapWidth: 1800, align: 'center' }); questionText.anchor.set(0.5, 0); questionText.x = 2048 / 2; questionText.y = 350; game.addChild(questionText); // --- ANSWER BUTTONS SETUP --- var btnSpacing = 320; var btnStartY = 800; for (var i = 0; i < 3; i++) { var btn = new AnswerButton(); btn.index = i; btn.x = 2048 / 2; btn.y = btnStartY + i * btnSpacing; // Assign select handler btn.onSelect = function (idx) { handleAnswer(idx); }; answerButtons.push(btn); game.addChild(btn); } // --- GAME LOGIC --- function showRound(roundIdx) { locked = false; selectedIndex = -1; var round = rounds[roundIdx]; // Set question text questionText.setText("Which one is a lie?"); // Set round/score roundText.setText('Round ' + (roundIdx + 1) + '/10'); scoreText.setText('Score: ' + score); // Shuffle answers for each round var indices = [0, 1, 2]; shuffleArray(indices); // Map: btnIdx -> original statement idx var btnToStatement = [indices[0], indices[1], indices[2]]; // Store mapping for answer checking showRound.btnToStatement = btnToStatement; showRound.lieIdx = round.lie; // Set button text and reset state for (var i = 0; i < 3; i++) { var statementIdx = btnToStatement[i]; answerButtons[i].setText(round.statements[statementIdx]); answerButtons[i].setState('default'); } } // Handle answer selection function handleAnswer(btnIdx) { if (locked) return; locked = true; selectedIndex = btnIdx; var round = rounds[currentRound]; var btnToStatement = showRound.btnToStatement; var selectedStatementIdx = btnToStatement[btnIdx]; var isCorrect = selectedStatementIdx === round.lie; // Mark selected for (var i = 0; i < 3; i++) { if (i === btnIdx) { if (isCorrect) { answerButtons[i].setState('correct'); } else { answerButtons[i].setState('wrong'); } } else { // Show correct answer if (btnToStatement[i] === round.lie) { answerButtons[i].setState('correct'); } else { answerButtons[i].setState('default'); } } } // Update score if (isCorrect) { score += 1; scoreText.setText('Score: ' + score); } // Wait, then next round or end LK.setTimeout(function () { currentRound += 1; if (currentRound < 10) { showRound(currentRound); } else { // Game over LK.setScore(score); LK.showGameOver(); } }, 1200); } // --- START GAME --- showRound(0); // --- CLEANUP ON GAME OVER (handled by LK) --- // --- (No update loop needed for this game) ---
/****
* Classes
****/
// No plugins needed for MVP
// AnswerButton: A selectable answer option
var AnswerButton = Container.expand(function () {
var self = Container.call(this);
// Default state
self.state = 'default'; // 'default', 'selected', 'correct', 'wrong'
self.index = 0; // 0,1,2
// Attach default button asset
var btn = self.attachAsset('answerBtn', {
anchorX: 0.5,
anchorY: 0.5
});
// Attach answer text
self.txt = new Text2('', {
size: 80,
fill: 0xFFFFFF,
wordWrap: true,
wordWrapWidth: 1500,
align: 'center'
});
self.txt.anchor.set(0.5, 0.5);
self.txt.x = 0;
self.txt.y = 0;
self.addChild(self.txt);
// Set answer text
self.setText = function (str) {
self.txt.setText(str);
};
// Set state: 'default', 'selected', 'correct', 'wrong'
self.setState = function (state) {
self.state = state;
if (state === 'default') {
btn.assetId = 'answerBtn';
} else if (state === 'selected') {
btn.assetId = 'answerBtnSelected';
} else if (state === 'correct') {
btn.assetId = 'answerBtnCorrect';
} else if (state === 'wrong') {
btn.assetId = 'answerBtnWrong';
}
// Swap asset
self.removeChild(btn);
btn = self.attachAsset(btn.assetId, {
anchorX: 0.5,
anchorY: 0.5
});
self.setChildIndex(btn, 0);
};
// Down event (touch/click)
self.down = function (x, y, obj) {
if (typeof self.onSelect === 'function') {
self.onSelect(self.index);
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x181c24
});
/****
* Game Code
****/
// Shapes for answer buttons
// --- DATA: 10 rounds, each with 3 statements (2 true, 1 lie) ---
// Each round: { statements: [str, str, str], lie: index }
var rounds = [{
statements: ["The heart of a shrimp is located in its head.", "Venus is the closest planet to the Sun.", "Bananas grow on plants that are technically herbs."],
lie: 1
}, {
statements: ["Honey never spoils and can last thousands of years.", "The Great Wall of China is visible from the Moon.", "Octopuses have three hearts."],
lie: 1
}, {
statements: ["A group of crows is called a murder.", "Humans and dinosaurs coexisted.", "The Eiffel Tower can be 15 cm taller during hot days."],
lie: 1
}, {
statements: ["Lightning can strike the same place twice.", "Goldfish only have a memory of three seconds.", "The unicorn is the national animal of Scotland."],
lie: 1
}, {
statements: ["There are more stars in the universe than grains of sand on Earth.", "Bats are blind.", "Some turtles can breathe through their butts."],
lie: 1
}, {
statements: ["The human nose can detect over 1 trillion smells.", "Mount Everest is the tallest mountain above sea level.", "Penguins can fly short distances."],
lie: 2
}, {
statements: ["The inventor of the lightbulb was Thomas Edison.", "A snail can sleep for three years.", "The Statue of Liberty was a gift from France."],
lie: 0
}, {
statements: ["The Amazon is the longest river in the world.", "Some metals are so reactive that they explode on contact with water.", "The fingerprints of a koala are so similar to humans that they can taint crime scenes."],
lie: 0
}, {
statements: ["The human body has four lungs.", "The Mona Lisa has no eyebrows.", "The speed of light is faster than the speed of sound."],
lie: 0
}, {
statements: ["The largest desert in the world is the Sahara.", "The tongue is the strongest muscle in the human body.", "A bolt of lightning contains enough energy to toast 100,000 slices of bread."],
lie: 1
}];
// Shuffle rounds for replayability
function shuffleArray(arr) {
for (var i = arr.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
shuffleArray(rounds);
// --- GAME STATE ---
var currentRound = 0;
var score = 0;
var selectedIndex = -1;
var locked = false; // Prevent multiple answers
var answerButtons = [];
var questionText = null;
var roundText = null;
var scoreText = null;
// --- GUI SETUP ---
// Score display (bottom left)
scoreText = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreText.anchor.set(0, 1);
scoreText.x = 60;
scoreText.y = LK.gui.bottom.height - 30;
LK.gui.bottomLeft.addChild(scoreText);
// Round display (bottom right)
roundText = new Text2('Round 1/10', {
size: 80,
fill: 0xFFFFFF
});
roundText.anchor.set(1, 1);
roundText.x = LK.gui.bottom.width - 60;
roundText.y = LK.gui.bottom.height - 30;
LK.gui.bottomRight.addChild(roundText);
// Question text (centered, above answers)
questionText = new Text2('', {
size: 90,
fill: 0xFFFBE6,
wordWrap: true,
wordWrapWidth: 1800,
align: 'center'
});
questionText.anchor.set(0.5, 0);
questionText.x = 2048 / 2;
questionText.y = 350;
game.addChild(questionText);
// --- ANSWER BUTTONS SETUP ---
var btnSpacing = 320;
var btnStartY = 800;
for (var i = 0; i < 3; i++) {
var btn = new AnswerButton();
btn.index = i;
btn.x = 2048 / 2;
btn.y = btnStartY + i * btnSpacing;
// Assign select handler
btn.onSelect = function (idx) {
handleAnswer(idx);
};
answerButtons.push(btn);
game.addChild(btn);
}
// --- GAME LOGIC ---
function showRound(roundIdx) {
locked = false;
selectedIndex = -1;
var round = rounds[roundIdx];
// Set question text
questionText.setText("Which one is a lie?");
// Set round/score
roundText.setText('Round ' + (roundIdx + 1) + '/10');
scoreText.setText('Score: ' + score);
// Shuffle answers for each round
var indices = [0, 1, 2];
shuffleArray(indices);
// Map: btnIdx -> original statement idx
var btnToStatement = [indices[0], indices[1], indices[2]];
// Store mapping for answer checking
showRound.btnToStatement = btnToStatement;
showRound.lieIdx = round.lie;
// Set button text and reset state
for (var i = 0; i < 3; i++) {
var statementIdx = btnToStatement[i];
answerButtons[i].setText(round.statements[statementIdx]);
answerButtons[i].setState('default');
}
}
// Handle answer selection
function handleAnswer(btnIdx) {
if (locked) return;
locked = true;
selectedIndex = btnIdx;
var round = rounds[currentRound];
var btnToStatement = showRound.btnToStatement;
var selectedStatementIdx = btnToStatement[btnIdx];
var isCorrect = selectedStatementIdx === round.lie;
// Mark selected
for (var i = 0; i < 3; i++) {
if (i === btnIdx) {
if (isCorrect) {
answerButtons[i].setState('correct');
} else {
answerButtons[i].setState('wrong');
}
} else {
// Show correct answer
if (btnToStatement[i] === round.lie) {
answerButtons[i].setState('correct');
} else {
answerButtons[i].setState('default');
}
}
}
// Update score
if (isCorrect) {
score += 1;
scoreText.setText('Score: ' + score);
}
// Wait, then next round or end
LK.setTimeout(function () {
currentRound += 1;
if (currentRound < 10) {
showRound(currentRound);
} else {
// Game over
LK.setScore(score);
LK.showGameOver();
}
}, 1200);
}
// --- START GAME ---
showRound(0);
// --- CLEANUP ON GAME OVER (handled by LK) ---
// --- (No update loop needed for this game) ---