User prompt
Also add the gradient backround and answer button styling
User prompt
Make the loading screen fast
User prompt
Make the game visible
User prompt
Remove the black background
User prompt
Make the game look more cool
User prompt
Add backgrounds
User prompt
Make the game harder with multiple different questions
User prompt
Position the answer text to the centre of each answer button
User prompt
Make the answer buttons bigger to press
User prompt
Generate new questions each time they play the game
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'self.color = new Graphics();' Line Number: 11
User prompt
Add button colors
Initial prompt
GameKahoot
===================================================================
--- original.js
+++ change.js
@@ -59,42 +59,34 @@
/****
* Game Code
****/
-// Questions and answers
-var questions = [{
- question: "What is the capital of France?",
- answers: [{
- text: "Paris",
- correct: true
- }, {
- text: "London",
- correct: false
- }, {
- text: "Berlin",
- correct: false
- }, {
- text: "Madrid",
- correct: false
- }]
-}, {
- question: "What is 2 + 2?",
- answers: [{
- text: "3",
- correct: false
- }, {
- text: "4",
- correct: true
- }, {
- text: "5",
- correct: false
- }, {
- text: "6",
- correct: false
- }]
+// Function to generate random questions
+function generateQuestions() {
+ var questions = [];
+ for (var i = 0; i < 10; i++) {
+ var question = {
+ question: "What is " + i + " + " + i + "?",
+ answers: [{
+ text: (i + i).toString(),
+ correct: true
+ }, {
+ text: (i + i + 1).toString(),
+ correct: false
+ }, {
+ text: (i + i - 1).toString(),
+ correct: false
+ }, {
+ text: (i + i + 2).toString(),
+ correct: false
+ }]
+ };
+ questions.push(question);
+ }
+ return questions;
}
-// Add more questions as needed
-];
+// Generate questions
+var questions = generateQuestions();
var currentQuestionIndex = 0;
var questionNode = new Question();
questionNode.x = 2048 / 2;
questionNode.y = 2732 / 4;