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 ****/ // Background image asset (2048x2732, covers full game area) var background = LK.getAsset('backgroundImg', { anchorX: 0, anchorY: 0, x: 0, y: 0 }); game.addChildAt(background, 0); // Shapes for answer buttons // --- DATA: 30 rounds, each with 3 statements (2 true, 1 lie) --- // Each round: { statements: [str, str, str], lie: index } var allQuestions = [{ 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 }, { statements: ["The capital of Australia is Sydney.", "The cheetah is the fastest land animal.", "The Pacific Ocean is the largest ocean on Earth."], lie: 0 }, { statements: ["Humans have more than five senses.", "The Great Pyramid of Giza was built by aliens.", "The hummingbird is the only bird that can fly backwards."], lie: 1 }, { statements: ["The blue whale is the largest animal ever to have lived.", "Mercury is the hottest planet in the solar system.", "The ostrich is the largest living bird."], lie: 1 }, { statements: ["The currency of Japan is the yen.", "Spiders are insects.", "The Nile is the longest river in Africa."], lie: 1 }, { statements: ["The human skeleton is made up of over 200 bones.", "The sun is a star.", "Mount Kilimanjaro is the tallest mountain in the world."], lie: 2 }, { statements: ["Sharks are mammals.", "The Amazon rainforest produces more than 20% of the world's oxygen.", "The koala is native to Australia."], lie: 0 }, { statements: ["The piano has 88 keys.", "The speed of sound is faster than the speed of light.", "The platypus lays eggs."], lie: 1 }, { statements: ["The capital of Canada is Toronto.", "The moon orbits the Earth.", "A group of lions is called a pride."], lie: 0 }, { statements: ["The Great Barrier Reef is located in Australia.", "Bamboo is a type of grass.", "The human body has two hearts."], lie: 2 }, { statements: ["The Atlantic Ocean is saltier than the Pacific Ocean.", "The giraffe is the tallest land animal.", "The kiwi is a flightless bird native to New Zealand."], lie: 0 }, { statements: ["The chemical symbol for gold is Au.", "The Sahara is the coldest desert in the world.", "The Amazon River flows through Brazil."], lie: 1 }, { statements: ["The largest planet in our solar system is Jupiter.", "The Mona Lisa was painted by Leonardo da Vinci.", "The Great Wall of China was built in the 20th century."], lie: 2 }, { statements: ["The platypus is venomous.", "The human body is about 60% water.", "The capital of France is Berlin."], lie: 2 }, { statements: ["The Statue of Liberty is in New York City.", "The kangaroo is native to South America.", "The human brain is the fattiest organ in the body."], lie: 1 }, { statements: ["The dodo is an extinct bird.", "The Amazon River is the longest river in the world.", "The Great Pyramid of Giza is in Egypt."], lie: 1 }, { statements: ["The chemical symbol for oxygen is O2.", "The ostrich is the fastest bird on land.", "The human eye can distinguish about 10 million different colors."], lie: 0 }, { statements: ["The currency of the United Kingdom is the euro.", "The blue whale is a mammal.", "The Sahara is a hot desert."], lie: 0 }, { statements: ["The Eiffel Tower is in Paris.", "The cheetah can run up to 120 km/h.", "The human body has 206 bones."], lie: 1 }, { statements: ["The capital of Italy is Rome.", "The platypus is a marsupial.", "The Nile River flows north."], lie: 1 }, { statements: ["The sun rises in the west.", "The Amazon rainforest is the largest rainforest in the world.", "The koala is a marsupial."], lie: 0 }]; // Shuffle allQuestions 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; } } // Select 10 random questions for this game shuffleArray(allQuestions); var rounds = []; for (var i = 0; i < 10; i++) { rounds.push(allQuestions[i]); } // --- 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: 100, fill: 0x000000, wordWrap: true, wordWrapWidth: 1800, align: 'center' }); questionText.anchor.set(0.5, 0); questionText.x = 2048 / 2; questionText.y = 400; game.addChild(questionText); // --- ANSWER BUTTONS SETUP --- var btnSpacing = 280; var btnStartY = 1600; 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 --- // Play background music (loops by default) LK.playMusic('bgmusic'); showRound(0); // --- CLEANUP ON GAME OVER (handled by LK) --- // --- (No update loop needed for this game) ---
===================================================================
--- original.js
+++ change.js
@@ -226,9 +226,9 @@
questionText.y = 400;
game.addChild(questionText);
// --- ANSWER BUTTONS SETUP ---
var btnSpacing = 280;
-var btnStartY = 1500;
+var btnStartY = 1600;
for (var i = 0; i < 3; i++) {
var btn = new AnswerButton();
btn.index = i;
btn.x = 2048 / 2;