User prompt
Add the cinema category
User prompt
Create a new category of mechanics
User prompt
Create a new class of health questions and when you complete them, the super health questions will heal your heart. βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
So only the difficult or super questions shine in a rainbow way βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let's add a new category of gastronomy questions
User prompt
So the scoreboard turns green, jumps, and then returns to normal for each correct answer. βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
So the background is light orange
User prompt
The game background looks very empty and without anything βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Proceed to do what you consider a visual improvement. βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
There is a bug that causes if you fail and touch the correct answer button you skip a question, it modifies the game For that only one button can be pressed at a time
User prompt
The voices weren't the best idea, just remove them.
User prompt
Modify the game so that hard questions give you 2 points instead of 1 and super questions give you 4.
User prompt
So when you answer a hard question correctly, a voice will say good, and when you answer a super difficulty question correctly, another voice will say super!
User prompt
As a small update
User prompt
So the questions with 4 possible answers have the super difficulty with red color
User prompt
Add extra difficult questions with 4 probable answers
User prompt
Add new intermediate level questions and some old intermediate level questions
User prompt
Add more normal questions and some new special ones
User prompt
Create an update that you consider good
User prompt
So in the background there is an answer area
User prompt
So the special questions do not have an order of appearance, they appear every certain questions randomly so that when you lose there is a little more element of surprise.
User prompt
So for every two questions there is a special one that instead of yes or no has a more complex answer like what is the largest plant in the world and it gives you two answers each one A large plant or one that is the largest in the world
User prompt
So the background icons are dark orange transparent instead of orange
User prompt
So the background is orange and the background has theme icons but orange and transparent.
User prompt
So let the song FALSEORTRUE play in the backgroun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var AnswerButton = Container.expand(function () { var self = Container.call(this); self.isCorrect = false; self.answered = false; // Button background self.buttonBg = self.attachAsset('answerButton', { anchorX: 0.5, anchorY: 0.5 }); // Answer text self.answerText = new Text2('', { size: 60, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 750 }); self.answerText.anchor.set(0.5, 0.5); self.addChild(self.answerText); self.setAnswer = function (text, correct) { self.answerText.setText(text); self.isCorrect = correct; }; self.showCorrect = function () { self.removeChild(self.buttonBg); self.buttonBg = self.attachAsset('correctButton', { anchorX: 0.5, anchorY: 0.5 }); self.addChildAt(self.buttonBg, 0); }; self.showWrong = function () { self.removeChild(self.buttonBg); self.buttonBg = self.attachAsset('wrongButton', { anchorX: 0.5, anchorY: 0.5 }); self.addChildAt(self.buttonBg, 0); }; self.move = function (x, y, obj) { if (self.answered) return; // Add subtle hover effect if (!self.isHovering) { self.isHovering = true; tween(self, { scaleX: 1.05, scaleY: 1.05 }, { duration: 150, easing: tween.easeOut }); } }; self.up = function (x, y, obj) { // Remove hover effect when touch/mouse is released if (self.isHovering) { self.isHovering = false; if (!self.answered) { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 150, easing: tween.easeOut }); } } }; self.down = function (x, y, obj) { if (self.answered) return; self.answered = true; answered = true; // Add press animation tween(self, { scaleX: 0.9, scaleY: 0.9 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.bounceOut }); } }); if (self.isCorrect) { // Correct answer self.showCorrect(); LK.effects.flashObject(self, 0x27ae60, 500); LK.getSound('correct').play(); LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); // Create particle celebration effect for (var p = 0; p < 8; p++) { var particle = game.addChild(new Particle()); var globalPos = self.parent.toGlobal(self.position); particle.animate(globalPos.x, globalPos.y); } // Add score celebration animation tween(scoreTxt, { scaleX: 1.3, scaleY: 1.3 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(scoreTxt, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeOut }); } }); // Show next question after delay LK.setTimeout(function () { showNextQuestion(); }, 1000); } else { // Wrong answer self.showWrong(); LK.effects.flashObject(self, 0xe74c3c, 500); LK.effects.flashScreen(0xe74c3c, 1000); LK.getSound('wrong').play(); // Show correct answer if (answerButton1.isCorrect) { answerButton1.showCorrect(); } else { answerButton2.showCorrect(); } // Lose a life lives--; livesTxt.setText('Lives: ' + lives); // Add life loss animation tween(livesTxt, { scaleX: 1.2, scaleY: 1.2, tint: 0xff0000 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { tween(livesTxt, { scaleX: 1, scaleY: 1, tint: 0xffffff }, { duration: 400, easing: tween.easeOut }); } }); // Check if game over or continue LK.setTimeout(function () { if (lives <= 0) { LK.showGameOver(); } else { showNextQuestion(); } }, 2000); } }; return self; }); var Particle = Container.expand(function () { var self = Container.call(this); self.particle = self.attachAsset('themeIcon1', { anchorX: 0.5, anchorY: 0.5 }); self.particle.width = 20; self.particle.height = 20; self.particle.tint = 0xFFD700; self.animate = function (targetX, targetY) { // Random velocity and angle var angle = Math.random() * Math.PI * 2; var speed = 100 + Math.random() * 200; var vx = Math.cos(angle) * speed; var vy = Math.sin(angle) * speed; self.x = targetX; self.y = targetY; // Animate particle with physics-like motion tween(self, { x: self.x + vx, y: self.y + vy, alpha: 0, scaleX: 0.1, scaleY: 0.1 }, { duration: 1000 + Math.random() * 500, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); } }); }; return self; }); var Question = Container.expand(function () { var self = Container.call(this); // Question background var questionBg = self.attachAsset('questionBox', { anchorX: 0.5, anchorY: 0.5 }); // Category icon self.categoryIcon = null; // Category text self.categoryText = null; // Question text self.questionText = new Text2('', { size: 80, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 1500 }); self.questionText.anchor.set(0.5, 0.5); self.questionText.x = 100; // Offset to make room for icon self.addChild(self.questionText); self.setQuestion = function (text, category, isSpecial) { self.questionText.setText(text); // Determine difficulty level based on question length and special status var difficulty = 'Easy'; var difficultyColor = 0x27ae60; // Green for easy if (isSpecial) { difficulty = 'Hard'; difficultyColor = 0xe74c3c; // Red for hard } else if (text.length > 100) { difficulty = 'Medium'; difficultyColor = 0xf39c12; // Orange for medium } // Remove existing category icon if any if (self.categoryIcon) { self.removeChild(self.categoryIcon); } // Add new category icon var iconAsset = category + 'Icon'; self.categoryIcon = self.attachAsset(iconAsset, { anchorX: 0.5, anchorY: 0.5 }); self.categoryIcon.x = -700; // Position to the left of text self.categoryIcon.y = -50; // Add special question indicator if (isSpecial) { self.categoryIcon.tint = 0xFFD700; // Gold tint for special questions } // Add category name text if (self.categoryText) { self.removeChild(self.categoryText); } var categoryDisplayText = category.charAt(0).toUpperCase() + category.slice(1); if (isSpecial) { categoryDisplayText += " β "; } categoryDisplayText += " (" + difficulty + ")"; self.categoryText = new Text2(categoryDisplayText, { size: 40, fill: isSpecial ? 0xFFD700 : difficultyColor }); self.categoryText.anchor.set(0.5, 0.5); self.categoryText.x = -700; // Same x as icon self.categoryText.y = 50; // Below the icon self.addChild(self.categoryText); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x34495e }); /**** * Game Code ****/ var questions = [{ question: "The Sun is a star.", answers: ["True", "False"], correct: 0, category: "science" }, { question: "Penguins can fly.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "What is the largest plant in the world?", answers: ["A Redwood Tree", "The General Sherman Tree"], correct: 1, category: "nature", special: true }, { question: "Water boils at 100Β°C at sea level.", answers: ["True", "False"], correct: 0, category: "science" }, { question: "The Great Wall of China is visible from space.", answers: ["True", "False"], correct: 1, category: "geography" }, { question: "Which planet is closest to the Sun?", answers: ["Venus", "Mercury"], correct: 1, category: "science", special: true }, { question: "Sharks are mammals.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "Lightning never strikes the same place twice.", answers: ["True", "False"], correct: 1, category: "science" }, { question: "What is the smallest country in the world?", answers: ["Monaco", "Vatican City"], correct: 1, category: "geography", special: true }, { question: "Goldfish have a 3-second memory.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "Bananas are berries.", answers: ["True", "False"], correct: 0, category: "nature" }, { question: "What is the deepest ocean trench?", answers: ["Puerto Rico Trench", "Mariana Trench"], correct: 1, category: "geography", special: true }, { question: "The human body has 206 bones.", answers: ["True", "False"], correct: 0, category: "science" }, { question: "Mount Everest is the tallest mountain on Earth.", answers: ["True", "False"], correct: 0, category: "geography" }, { question: "Which mammal is known to have the most powerful bite?", answers: ["Lion", "Hippopotamus"], correct: 1, category: "nature", special: true }, { question: "Octopuses have three hearts.", answers: ["True", "False"], correct: 0, category: "nature" }, { question: "The Earth is flat.", answers: ["True", "False"], correct: 1, category: "geography" }, { question: "What is the hardest natural substance on Earth?", answers: ["Titanium", "Diamond"], correct: 1, category: "science", special: true }, { question: "Honey never spoils.", answers: ["True", "False"], correct: 0, category: "general" }, { question: "Humans only use 10% of their brain.", answers: ["True", "False"], correct: 1, category: "science" }, { question: "The Moon has its own light.", answers: ["True", "False"], correct: 1, category: "science" }, { question: "Spiders are insects.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "The Sahara is the largest desert in the world.", answers: ["True", "False"], correct: 1, category: "geography" }, { question: "All birds can fly.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "The Statue of Liberty was a gift from France.", answers: ["True", "False"], correct: 0, category: "history" }, { question: "Fish can drown in water.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "Antarctica is the coldest continent.", answers: ["True", "False"], correct: 0, category: "geography" }, { question: "Dolphins are fish.", answers: ["True", "False"], correct: 1, category: "nature" }, { question: "The Amazon River is longer than the Nile River.", answers: ["True", "False"], correct: 0, category: "geography" }, { question: "Glass is a liquid.", answers: ["True", "False"], correct: 1, category: "science" }, { question: "Crocodiles are older than dinosaurs.", answers: ["True", "False"], correct: 0, category: "history" }, { question: "The human heart has four chambers.", answers: ["True", "False"], correct: 0, category: "science" }, { question: "Which was invented first?", answers: ["The wheel", "Sliced bread"], correct: 0, category: "history", special: true }, { question: "What causes thunder?", answers: ["Lightning heating air", "Clouds colliding"], correct: 0, category: "science", special: true }, { question: "Which animal sleeps the most per day?", answers: ["Sloth", "Koala"], correct: 1, category: "nature", special: true }, { question: "What is the most spoken language in the world?", answers: ["English", "Mandarin Chinese"], correct: 1, category: "general", special: true }, { question: "Which ocean is the largest?", answers: ["Atlantic Ocean", "Pacific Ocean"], correct: 1, category: "geography", special: true }, { question: "What is the fastest land animal?", answers: ["Cheetah", "Pronghorn Antelope"], correct: 0, category: "nature", special: true }]; var currentQuestionIndex = 0; var answered = false; var lives = 3; var questionsAnswered = 0; var nextSpecialQuestionAt = 3; // First special question after 3 questions // Score display var scoreTxt = new Text2('0', { size: 120, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Lives display var livesTxt = new Text2('Lives: 3', { size: 80, fill: 0xFFFFFF }); livesTxt.anchor.set(1, 0); LK.gui.topRight.addChild(livesTxt); // Progress indicator var progressTxt = new Text2('Question 1', { size: 60, fill: 0xFFFFFF }); progressTxt.anchor.set(0, 0); progressTxt.x = 120; // Avoid top-left menu area progressTxt.y = 20; LK.gui.topLeft.addChild(progressTxt); // Question display var questionDisplay = game.addChild(new Question()); questionDisplay.x = 2048 / 2; questionDisplay.y = 800; // Answer buttons var answerButton1 = game.addChild(new AnswerButton()); answerButton1.x = 2048 / 2 - 450; answerButton1.y = 1600; var answerButton2 = game.addChild(new AnswerButton()); answerButton2.x = 2048 / 2 + 450; answerButton2.y = 1600; function showNextQuestion() { // Check if we need to generate more questions if (mixedQuestions.length <= currentQuestionIndex) { // Check if we have questions left to add if (regularIndex >= regularQuestions.length && specialIndex >= specialQuestions.length) { // Player completed all questions - they win! LK.showYouWin(); return; } // Determine if next question should be special var shouldShowSpecial = questionsAnswered >= nextSpecialQuestionAt && specialIndex < specialQuestions.length; if (shouldShowSpecial) { // Add special question mixedQuestions.push(specialQuestions[specialIndex]); specialIndex++; // Schedule next special question randomly (every 2-4 questions) nextSpecialQuestionAt = questionsAnswered + 2 + Math.floor(Math.random() * 3); } else if (regularIndex < regularQuestions.length) { // Add regular question mixedQuestions.push(regularQuestions[regularIndex]); regularIndex++; } else { // Only special questions left mixedQuestions.push(specialQuestions[specialIndex]); specialIndex++; } } var question = mixedQuestions[currentQuestionIndex]; // Reset button states answered = false; answerButton1.answered = false; answerButton2.answered = false; // Reset button graphics answerButton1.removeChild(answerButton1.buttonBg); answerButton1.buttonBg = answerButton1.attachAsset('answerButton', { anchorX: 0.5, anchorY: 0.5 }); answerButton1.addChildAt(answerButton1.buttonBg, 0); answerButton2.removeChild(answerButton2.buttonBg); answerButton2.buttonBg = answerButton2.attachAsset('answerButton', { anchorX: 0.5, anchorY: 0.5 }); answerButton2.addChildAt(answerButton2.buttonBg, 0); // Update progress indicator var totalQuestions = Math.min(questions.length, 20); // Limit display to reasonable number progressTxt.setText('Question ' + Math.min(questionsAnswered, totalQuestions)); // Set question and answers questionDisplay.setQuestion(question.question, question.category, question.special); answerButton1.setAnswer(question.answers[0], question.correct === 0); answerButton2.setAnswer(question.answers[1], question.correct === 1); // Reset hover states answerButton1.isHovering = false; answerButton2.isHovering = false; // Animate elements entrance questionDisplay.alpha = 0; questionDisplay.scaleX = 0.5; questionDisplay.scaleY = 0.5; tween(questionDisplay, { alpha: 1, scaleX: 1, scaleY: 1 }, { duration: 600, easing: tween.easeOut }); answerButton1.alpha = 0; answerButton1.y = 1800; tween(answerButton1, { alpha: 1, y: 1600 }, { duration: 500, easing: tween.easeOut }); answerButton2.alpha = 0; answerButton2.y = 1800; tween(answerButton2, { alpha: 1, y: 1600 }, { duration: 500, easing: tween.easeOut }); currentQuestionIndex++; questionsAnswered++; } // Separate questions into regular and special arrays var regularQuestions = []; var specialQuestions = []; for (var i = 0; i < questions.length; i++) { if (questions[i].special) { specialQuestions.push(questions[i]); } else { regularQuestions.push(questions[i]); } } // Shuffle both arrays function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } shuffleArray(regularQuestions); shuffleArray(specialQuestions); // Create mixed question sequence var mixedQuestions = []; var regularIndex = 0; var specialIndex = 0; // Start the game with entrance animations scoreTxt.setText(LK.getScore()); // Initial setup - hide elements for entrance animation questionDisplay.alpha = 0; answerButton1.alpha = 0; answerButton2.alpha = 0; // Animate score text entrance scoreTxt.y = -100; tween(scoreTxt, { y: 0 }, { duration: 800, easing: tween.bounceOut }); // Animate lives text entrance livesTxt.y = -100; tween(livesTxt, { y: 0 }, { duration: 900, easing: tween.bounceOut }); // Play background music LK.playMusic('FALSEorTRUE'); // Start first question after UI animations LK.setTimeout(function () { showNextQuestion(); }, 500); ;
===================================================================
--- original.js
+++ change.js
@@ -393,8 +393,104 @@
question: "Humans only use 10% of their brain.",
answers: ["True", "False"],
correct: 1,
category: "science"
+}, {
+ question: "The Moon has its own light.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "science"
+}, {
+ question: "Spiders are insects.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "nature"
+}, {
+ question: "The Sahara is the largest desert in the world.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "geography"
+}, {
+ question: "All birds can fly.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "nature"
+}, {
+ question: "The Statue of Liberty was a gift from France.",
+ answers: ["True", "False"],
+ correct: 0,
+ category: "history"
+}, {
+ question: "Fish can drown in water.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "nature"
+}, {
+ question: "Antarctica is the coldest continent.",
+ answers: ["True", "False"],
+ correct: 0,
+ category: "geography"
+}, {
+ question: "Dolphins are fish.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "nature"
+}, {
+ question: "The Amazon River is longer than the Nile River.",
+ answers: ["True", "False"],
+ correct: 0,
+ category: "geography"
+}, {
+ question: "Glass is a liquid.",
+ answers: ["True", "False"],
+ correct: 1,
+ category: "science"
+}, {
+ question: "Crocodiles are older than dinosaurs.",
+ answers: ["True", "False"],
+ correct: 0,
+ category: "history"
+}, {
+ question: "The human heart has four chambers.",
+ answers: ["True", "False"],
+ correct: 0,
+ category: "science"
+}, {
+ question: "Which was invented first?",
+ answers: ["The wheel", "Sliced bread"],
+ correct: 0,
+ category: "history",
+ special: true
+}, {
+ question: "What causes thunder?",
+ answers: ["Lightning heating air", "Clouds colliding"],
+ correct: 0,
+ category: "science",
+ special: true
+}, {
+ question: "Which animal sleeps the most per day?",
+ answers: ["Sloth", "Koala"],
+ correct: 1,
+ category: "nature",
+ special: true
+}, {
+ question: "What is the most spoken language in the world?",
+ answers: ["English", "Mandarin Chinese"],
+ correct: 1,
+ category: "general",
+ special: true
+}, {
+ question: "Which ocean is the largest?",
+ answers: ["Atlantic Ocean", "Pacific Ocean"],
+ correct: 1,
+ category: "geography",
+ special: true
+}, {
+ question: "What is the fastest land animal?",
+ answers: ["Cheetah", "Pronghorn Antelope"],
+ correct: 0,
+ category: "nature",
+ special: true
}];
var currentQuestionIndex = 0;
var answered = false;
var lives = 3;
Long Burton. In-Game asset. 2d. High contrast. No shadows
Long button. In-Game asset. 2d. High contrast. No shadows
Long, shiny green button. In-Game asset. 2d. High contrast. No shadows
Long Bright red button. In-Game asset. 2d. High contrast. No shadows
Science icon. In-Game asset. 2d. High contrast. No shadows
Minimalist nature icon. In-Game asset. 2d. High contrast. No shadows
Minimalist geography icon. In-Game asset. 2d. High contrast. No shadows
Minimalist icon for general topics. In-Game asset. 2d. High contrast. No shadows
Minimalist icon of history. In-Game asset. 2d. High contrast. No shadows
Dark orange circular minimalist roulette. In-Game asset. 2d. High contrast. No shadows
Minimalist medical icon. In-Game asset. 2d. High contrast. No shadows
Minimalist mechanics icon. In-Game asset. 2d. High contrast. No shadows
Minimalist film icon. In-Game asset. 2d. High contrast. No shadows