User prompt
Oyuncu Quick time eventler ve halat çekme yarısında kaybedilirse 20 puan ve 1 can kaybetsin
User prompt
Halat çekme yarısını zorlaştır ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: this.destroy is not a function' in or related to this line: 'this.destroy();' Line Number: 4161
User prompt
Please fix the bug: 'TypeError: this.destroy is not a function' in or related to this line: 'this.destroy();' Line Number: 4124
User prompt
Please fix the bug: 'TypeError: this.destroy is not a function' in or related to this line: 'this.destroy();' Line Number: 4021
User prompt
Halat yarısını zorlaştır ayrıca halatın animasyonlarını efektlerini ve dizaynını daha kaliteli yap halat yarısı için ayrı bir ekran yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Pekala birde quic time event ekleyelim arada bir ortaya çıksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Soruların arasına bazen yetenek yarışması ekle mesela ekrana hızlı hızlı basmamız gereken bir halat çekme yarışı ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Hataları düzelt
User prompt
In the game's opening dialogue after the intro, let AI mock the player and ask questions. Add cutscenes between the questions and let us make choices in these scenes. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
İntoryu oyunu çalıştırmadan önce pixel art yazılar ve basit animasyonlarla yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Kalpler yok olurken patlasın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyuna can ekle kalp simgesi olsun 3 adet kalp olsun her hatada bir animasyonla 1 kalp yok olur 3 kalp biterse oyun biter ayrıca 3 seçenek değişsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Bir intro ekle yazılar olsun intro bir hikaye anlatsın hikaye : yapay zeka ana karakterimizi kaçırdı ve tehtid ederek zorla diğer yarışmacılarla beraber bilgi yarışmasına sokuyor ayrıca bir aı düşman ekle oda arada bir puan kazanacak ve ilk 1000 puana ulaşan kazanacak ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
We increased the font size, make it fullscreen
User prompt
Mor partiküllü koyu mavi bir arka plan ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The order in which the questions are asked should be random.
User prompt
Add more questions Add 300 questions
User prompt
daha fazla soru ekleyin ve ekran geçişleri için bir animasyon ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
After clicking on the play button, you will be presented with 3 different options: History questions, Science and mathematics, expert (all)
User prompt
Add language options to settings and add Turkish language support
User prompt
Add settings to main menu
User prompt
Add a main menu
User prompt
Make questions harder and add 100 questions
Code edit (1 edits merged)
Please save this source code
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var ChatMessage = Container.expand(function (message, isAI, yPos) {
var self = Container.call(this);
var bubbleColor = isAI ? 0xe8f4fd : 0x4a9eff;
var textColor = isAI ? "#333333" : "#ffffff";
var alignX = isAI ? 0 : 1;
var bubble = self.attachAsset(isAI ? 'chatBubbleAI' : 'chatBubbleUser', {
anchorX: alignX,
anchorY: 0
});
var messageText = new Text2(message, {
size: 40,
fill: textColor,
wordWrap: true,
wordWrapWidth: 550
});
messageText.anchor.set(alignX, 0);
messageText.x = alignX === 0 ? 25 : -25;
messageText.y = 20;
self.addChild(messageText);
// Adjust bubble height based on text
var textHeight = messageText.height;
bubble.height = Math.max(120, textHeight + 40);
self.x = alignX === 0 ? 150 : 1898;
self.y = yPos;
self.getBubbleHeight = function () {
return bubble.height;
};
return self;
});
var MenuButton = Container.expand(function (text, callback) {
var self = Container.call(this);
var button = self.attachAsset('playButton', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(text, {
size: 50,
fill: 0xffffff
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.callback = callback;
self.down = function (x, y, obj) {
button.tint = 0x3a7fcf;
if (self.callback) {
self.callback();
}
};
self.up = function (x, y, obj) {
button.tint = 0xffffff;
};
return self;
});
var OptionButton = Container.expand(function (text, callback) {
var self = Container.call(this);
var button = self.attachAsset('option1Button', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(text, {
size: 45,
fill: 0x333333,
wordWrap: true,
wordWrapWidth: 1400
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.callback = callback;
self.down = function (x, y, obj) {
button.tint = 0xdddddd;
if (self.callback) {
self.callback();
}
};
self.up = function (x, y, obj) {
button.tint = 0xffffff;
};
return self;
});
var SettingsButton = Container.expand(function (text, callback) {
var self = Container.call(this);
var button = self.attachAsset('playButton', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(text, {
size: 50,
fill: 0xffffff
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.callback = callback;
self.down = function (x, y, obj) {
button.tint = 0x3a7fcf;
if (self.callback) {
self.callback();
}
};
self.up = function (x, y, obj) {
button.tint = 0xffffff;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xf0f8ff
});
/****
* Game Code
****/
var chatMessages = [];
var currentQuestion = 0;
var score = 0;
var gamePhase = 'menu'; // menu, intro, question, complete, settings
var messagesContainer = new Container();
var optionsContainer = new Container();
var menuContainer = new Container();
var settingsContainer = new Container();
var scrollOffset = 0;
var maxScroll = 0;
var soundEnabled = true;
var difficulty = 'Normal'; // Easy, Normal, Hard
var currentLanguage = 'english'; // english, turkish
// AI Questions and responses - 100 challenging questions
var questionsEnglish = [{
question: "What is the derivative of x² with respect to x?",
options: ["x", "2x", "x²"],
correct: 1,
response: "Excellent! The derivative of x² is indeed 2x."
}, {
question: "Which programming paradigm emphasizes immutability?",
options: ["Object-oriented", "Functional", "Procedural"],
correct: 1,
response: "Correct! Functional programming emphasizes immutability."
}, {
question: "What is the time complexity of binary search?",
options: ["O(n)", "O(log n)", "O(n²)"],
correct: 1,
response: "Perfect! Binary search has O(log n) time complexity."
}, {
question: "Which element has the atomic number 79?",
options: ["Silver", "Gold", "Platinum"],
correct: 1,
response: "Right! Gold has atomic number 79."
}, {
question: "What does HTTP stand for?",
options: ["HyperText Transfer Protocol", "High Transfer Text Protocol", "HyperText Transmission Protocol"],
correct: 0,
response: "Excellent! HTTP is HyperText Transfer Protocol."
}, {
question: "In quantum physics, what is Schrödinger's cat an example of?",
options: ["Wave-particle duality", "Quantum superposition", "Quantum entanglement"],
correct: 1,
response: "Correct! It demonstrates quantum superposition."
}, {
question: "What is the square root of 144?",
options: ["11", "12", "13"],
correct: 1,
response: "Perfect! √144 = 12."
}, {
question: "Which data structure uses LIFO principle?",
options: ["Queue", "Stack", "Array"],
correct: 1,
response: "Right! Stack uses Last In, First Out (LIFO)."
}, {
question: "What is the capital of Australia?",
options: ["Sydney", "Melbourne", "Canberra"],
correct: 2,
response: "Correct! Canberra is Australia's capital."
}, {
question: "In chess, how many squares are on the board?",
options: ["64", "81", "49"],
correct: 0,
response: "Excellent! A chess board has 64 squares."
}, {
question: "What is the chemical formula for water?",
options: ["H2O", "CO2", "NaCl"],
correct: 0,
response: "Perfect! Water is H2O."
}, {
question: "Which sorting algorithm has the best average case time complexity?",
options: ["Bubble Sort", "Quick Sort", "Selection Sort"],
correct: 1,
response: "Correct! Quick Sort has O(n log n) average case."
}, {
question: "What is 15% of 200?",
options: ["25", "30", "35"],
correct: 1,
response: "Right! 15% of 200 is 30."
}, {
question: "In which year did World War II end?",
options: ["1944", "1945", "1946"],
correct: 1,
response: "Correct! World War II ended in 1945."
}, {
question: "What is the largest planet in our solar system?",
options: ["Saturn", "Jupiter", "Neptune"],
correct: 1,
response: "Excellent! Jupiter is the largest planet."
}, {
question: "Which database type is MongoDB?",
options: ["Relational", "NoSQL", "Graph"],
correct: 1,
response: "Correct! MongoDB is a NoSQL database."
}, {
question: "What is the integral of 1/x dx?",
options: ["x", "ln|x|", "1/x²"],
correct: 1,
response: "Perfect! The integral of 1/x is ln|x| + C."
}, {
question: "Which country has the most time zones?",
options: ["USA", "Russia", "China"],
correct: 1,
response: "Right! Russia has 11 time zones."
}, {
question: "What does CPU stand for?",
options: ["Central Processing Unit", "Computer Processing Unit", "Central Program Unit"],
correct: 0,
response: "Excellent! CPU is Central Processing Unit."
}, {
question: "In binary, what is 1010?",
options: ["8", "10", "12"],
correct: 1,
response: "Correct! Binary 1010 equals decimal 10."
}, {
question: "Who wrote '1984'?",
options: ["Aldous Huxley", "George Orwell", "Ray Bradbury"],
correct: 1,
response: "Perfect! George Orwell wrote '1984'."
}, {
question: "What is the speed of light in vacuum?",
options: ["299,792,458 m/s", "300,000,000 m/s", "299,000,000 m/s"],
correct: 0,
response: "Excellent! Light travels at 299,792,458 m/s in vacuum."
}, {
question: "Which protocol is used for secure web browsing?",
options: ["HTTP", "HTTPS", "FTP"],
correct: 1,
response: "Correct! HTTPS is used for secure web browsing."
}, {
question: "What is the formula for the area of a circle?",
options: ["πr", "πr²", "2πr"],
correct: 1,
response: "Perfect! Area of a circle is πr²."
}, {
question: "Which programming language was created by Guido van Rossum?",
options: ["Java", "Python", "Ruby"],
correct: 1,
response: "Right! Python was created by Guido van Rossum."
}, {
question: "What is the boiling point of water at sea level?",
options: ["90°C", "100°C", "110°C"],
correct: 1,
response: "Correct! Water boils at 100°C at sea level."
}, {
question: "In networking, what does DNS stand for?",
options: ["Domain Name System", "Data Network Service", "Dynamic Name Server"],
correct: 0,
response: "Excellent! DNS is Domain Name System."
}, {
question: "What is the result of 2³?",
options: ["6", "8", "9"],
correct: 1,
response: "Perfect! 2³ = 8."
}, {
question: "Which continent has the most countries?",
options: ["Asia", "Africa", "Europe"],
correct: 1,
response: "Correct! Africa has 54 countries."
}, {
question: "What does RAM stand for?",
options: ["Random Access Memory", "Read Access Memory", "Rapid Access Memory"],
correct: 0,
response: "Right! RAM is Random Access Memory."
}, {
question: "In physics, what is the unit of force?",
options: ["Joule", "Newton", "Watt"],
correct: 1,
response: "Excellent! Force is measured in Newtons."
}, {
question: "What is the largest ocean on Earth?",
options: ["Atlantic", "Pacific", "Indian"],
correct: 1,
response: "Correct! The Pacific Ocean is the largest."
}, {
question: "Which language is primarily used for web styling?",
options: ["HTML", "CSS", "JavaScript"],
correct: 1,
response: "Perfect! CSS is used for web styling."
}, {
question: "What is the value of π (pi) to 2 decimal places?",
options: ["3.14", "3.15", "3.16"],
correct: 0,
response: "Right! π ≈ 3.14."
}, {
question: "Who painted the Mona Lisa?",
options: ["Michelangelo", "Leonardo da Vinci", "Raphael"],
correct: 1,
response: "Excellent! Leonardo da Vinci painted the Mona Lisa."
}, {
question: "What is the chemical symbol for iron?",
options: ["I", "Fe", "Ir"],
correct: 1,
response: "Correct! Iron's chemical symbol is Fe."
}, {
question: "In object-oriented programming, what does inheritance allow?",
options: ["Code reuse", "Data hiding", "Polymorphism"],
correct: 0,
response: "Perfect! Inheritance allows code reuse."
}, {
question: "What is the smallest prime number?",
options: ["1", "2", "3"],
correct: 1,
response: "Right! 2 is the smallest prime number."
}, {
question: "Which planet is known as the Red Planet?",
options: ["Venus", "Mars", "Jupiter"],
correct: 1,
response: "Excellent! Mars is known as the Red Planet."
}, {
question: "What does SQL stand for?",
options: ["Structured Query Language", "Simple Query Language", "Standard Query Language"],
correct: 0,
response: "Correct! SQL is Structured Query Language."
}, {
question: "What is 7 × 8?",
options: ["54", "56", "58"],
correct: 1,
response: "Perfect! 7 × 8 = 56."
}, {
question: "Which gas makes up most of Earth's atmosphere?",
options: ["Oxygen", "Nitrogen", "Carbon Dioxide"],
correct: 1,
response: "Right! Nitrogen makes up about 78% of the atmosphere."
}, {
question: "In which year was the World Wide Web invented?",
options: ["1989", "1991", "1993"],
correct: 0,
response: "Excellent! The WWW was invented in 1989."
}, {
question: "What is the capital of Japan?",
options: ["Osaka", "Tokyo", "Kyoto"],
correct: 1,
response: "Correct! Tokyo is Japan's capital."
}, {
question: "Which data type stores true/false values?",
options: ["Integer", "Boolean", "String"],
correct: 1,
response: "Perfect! Boolean stores true/false values."
}, {
question: "What is the freezing point of water in Fahrenheit?",
options: ["30°F", "32°F", "34°F"],
correct: 1,
response: "Right! Water freezes at 32°F."
}, {
question: "Who developed the theory of relativity?",
options: ["Newton", "Einstein", "Galileo"],
correct: 1,
response: "Excellent! Albert Einstein developed relativity theory."
}, {
question: "What is the longest river in the world?",
options: ["Amazon", "Nile", "Yangtze"],
correct: 1,
response: "Correct! The Nile is the longest river."
}, {
question: "In programming, what is recursion?",
options: ["A loop", "A function calling itself", "Error handling"],
correct: 1,
response: "Perfect! Recursion is a function calling itself."
}, {
question: "What is 144 ÷ 12?",
options: ["11", "12", "13"],
correct: 1,
response: "Right! 144 ÷ 12 = 12."
}, {
question: "Which vitamin is produced by skin exposure to sunlight?",
options: ["Vitamin C", "Vitamin D", "Vitamin K"],
correct: 1,
response: "Excellent! Vitamin D is produced by sunlight."
}, {
question: "What does API stand for?",
options: ["Application Programming Interface", "Advanced Programming Interface", "Automated Programming Interface"],
correct: 0,
response: "Correct! API is Application Programming Interface."
}, {
question: "What is the sum of angles in a triangle?",
options: ["180°", "360°", "90°"],
correct: 0,
response: "Perfect! Triangle angles sum to 180°."
}, {
question: "Which element has the symbol 'O'?",
options: ["Gold", "Oxygen", "Silver"],
correct: 1,
response: "Right! 'O' is the symbol for Oxygen."
}, {
question: "In databases, what does CRUD stand for?",
options: ["Create Read Update Delete", "Copy Read Update Delete", "Create Retrieve Update Delete"],
correct: 0,
response: "Excellent! CRUD is Create, Read, Update, Delete."
}, {
question: "What is the cube of 3?",
options: ["9", "27", "81"],
correct: 1,
response: "Correct! 3³ = 27."
}, {
question: "Which ocean is between Europe and America?",
options: ["Pacific", "Atlantic", "Indian"],
correct: 1,
response: "Perfect! The Atlantic Ocean is between Europe and America."
}, {
question: "What does HTML stand for?",
options: ["HyperText Markup Language", "High Tech Modern Language", "HyperText Modern Language"],
correct: 0,
response: "Right! HTML is HyperText Markup Language."
}, {
question: "What is the square of 9?",
options: ["18", "81", "72"],
correct: 1,
response: "Excellent! 9² = 81."
}, {
question: "Who is known as the father of computers?",
options: ["Alan Turing", "Charles Babbage", "John von Neumann"],
correct: 1,
response: "Correct! Charles Babbage is called the father of computers."
}, {
question: "What is the chemical formula for table salt?",
options: ["NaCl", "KCl", "CaCl2"],
correct: 0,
response: "Perfect! Table salt is NaCl (sodium chloride)."
}, {
question: "In which layer of the atmosphere do we live?",
options: ["Stratosphere", "Troposphere", "Mesosphere"],
correct: 1,
response: "Right! We live in the troposphere."
}, {
question: "What does JSON stand for?",
options: ["JavaScript Object Notation", "Java Standard Object Notation", "JavaScript Oriented Notation"],
correct: 0,
response: "Excellent! JSON is JavaScript Object Notation."
}, {
question: "What is 25% of 80?",
options: ["15", "20", "25"],
correct: 1,
response: "Correct! 25% of 80 is 20."
}, {
question: "Which instrument measures atmospheric pressure?",
options: ["Thermometer", "Barometer", "Hygrometer"],
correct: 1,
response: "Perfect! A barometer measures atmospheric pressure."
}, {
question: "What is the basic unit of life?",
options: ["Tissue", "Cell", "Organ"],
correct: 1,
response: "Right! The cell is the basic unit of life."
}, {
question: "In networking, what is an IP address?",
options: ["Internet Protocol address", "Internal Program address", "Internet Program address"],
correct: 0,
response: "Excellent! IP stands for Internet Protocol."
}, {
question: "What is the result of 6!? (6 factorial)",
options: ["36", "720", "120"],
correct: 1,
response: "Correct! 6! = 720."
}, {
question: "Which continent is the Sahara Desert located in?",
options: ["Asia", "Africa", "Australia"],
correct: 1,
response: "Perfect! The Sahara Desert is in Africa."
}, {
question: "What does CSS stand for?",
options: ["Computer Style Sheets", "Cascading Style Sheets", "Creative Style Sheets"],
correct: 1,
response: "Right! CSS is Cascading Style Sheets."
}, {
question: "What is the distance from Earth to the Sun called?",
options: ["Light year", "Astronomical Unit", "Parsec"],
correct: 1,
response: "Excellent! It's called an Astronomical Unit (AU)."
}, {
question: "In mathematics, what is the value of e (Euler's number) approximately?",
options: ["2.718", "3.14", "1.618"],
correct: 0,
response: "Correct! Euler's number e ≈ 2.718."
}, {
question: "Which programming paradigm focuses on objects and classes?",
options: ["Functional", "Object-oriented", "Procedural"],
correct: 1,
response: "Perfect! Object-oriented programming focuses on objects and classes."
}, {
question: "What is the hardest natural substance?",
options: ["Gold", "Diamond", "Iron"],
correct: 1,
response: "Right! Diamond is the hardest natural substance."
}, {
question: "In physics, what is entropy a measure of?",
options: ["Energy", "Disorder", "Temperature"],
correct: 1,
response: "Excellent! Entropy measures disorder in a system."
}, {
question: "What is the binary representation of decimal 5?",
options: ["101", "110", "100"],
correct: 0,
response: "Correct! Decimal 5 is 101 in binary."
}, {
question: "Which mountain range contains Mount Everest?",
options: ["Andes", "Himalayas", "Alps"],
correct: 1,
response: "Perfect! Mount Everest is in the Himalayas."
}, {
question: "What does GPU stand for?",
options: ["General Processing Unit", "Graphics Processing Unit", "Global Processing Unit"],
correct: 1,
response: "Right! GPU is Graphics Processing Unit."
}, {
question: "What is the slope of a horizontal line?",
options: ["1", "0", "Undefined"],
correct: 1,
response: "Excellent! A horizontal line has slope 0."
}, {
question: "Which scientist proposed the laws of planetary motion?",
options: ["Galileo", "Kepler", "Copernicus"],
correct: 1,
response: "Correct! Johannes Kepler proposed the laws of planetary motion."
}, {
question: "What is the most abundant gas in the universe?",
options: ["Oxygen", "Hydrogen", "Helium"],
correct: 1,
response: "Perfect! Hydrogen is the most abundant gas in the universe."
}, {
question: "In computer science, what is Big O notation used for?",
options: ["Code organization", "Algorithm complexity", "Data storage"],
correct: 1,
response: "Right! Big O notation describes algorithm complexity."
}, {
question: "What is the chemical name for baking soda?",
options: ["Sodium chloride", "Sodium bicarbonate", "Sodium carbonate"],
correct: 1,
response: "Excellent! Baking soda is sodium bicarbonate."
}, {
question: "Which data structure is best for implementing a priority queue?",
options: ["Array", "Heap", "Stack"],
correct: 1,
response: "Correct! A heap is ideal for priority queues."
}, {
question: "What is the powerhouse of the cell?",
options: ["Nucleus", "Mitochondria", "Ribosome"],
correct: 1,
response: "Perfect! Mitochondria is the powerhouse of the cell."
}, {
question: "In networking, what layer of the OSI model does HTTP operate at?",
options: ["Layer 6", "Layer 7", "Layer 5"],
correct: 1,
response: "Right! HTTP operates at Layer 7 (Application layer)."
}, {
question: "What is the logarithm base 10 of 1000?",
options: ["2", "3", "4"],
correct: 1,
response: "Excellent! log₁₀(1000) = 3."
}, {
question: "Which programming language is known for 'write once, run anywhere'?",
options: ["C++", "Java", "Python"],
correct: 1,
response: "Correct! Java is known for 'write once, run anywhere'."
}, {
question: "What is the study of earthquakes called?",
options: ["Geology", "Seismology", "Meteorology"],
correct: 1,
response: "Perfect! Seismology is the study of earthquakes."
}, {
question: "In mathematics, what is an irrational number?",
options: ["A negative number", "A number that can't be expressed as a fraction", "A complex number"],
correct: 1,
response: "Right! An irrational number can't be expressed as a simple fraction."
}, {
question: "What does MVC stand for in software architecture?",
options: ["Model View Controller", "Multiple View Controller", "Model Variable Controller"],
correct: 0,
response: "Excellent! MVC is Model-View-Controller."
}, {
question: "What is the smallest unit of computer memory?",
options: ["Byte", "Bit", "Kilobyte"],
correct: 1,
response: "Correct! A bit is the smallest unit of computer memory."
}, {
question: "Which force keeps planets in orbit around the Sun?",
options: ["Magnetic force", "Gravitational force", "Nuclear force"],
correct: 1,
response: "Perfect! Gravitational force keeps planets in orbit."
}, {
question: "What is the time complexity of accessing an element in a hash table (average case)?",
options: ["O(1)", "O(log n)", "O(n)"],
correct: 0,
response: "Right! Hash table access is O(1) on average."
}, {
question: "What is the capital of Canada?",
options: ["Toronto", "Ottawa", "Vancouver"],
correct: 1,
response: "Excellent! Ottawa is Canada's capital."
}, {
question: "In chemistry, what is the pH of pure water?",
options: ["6", "7", "8"],
correct: 1,
response: "Correct! Pure water has a pH of 7 (neutral)."
}, {
question: "What does IDE stand for in programming?",
options: ["Integrated Development Environment", "Interactive Development Environment", "Internal Development Environment"],
correct: 0,
response: "Perfect! IDE is Integrated Development Environment."
}, {
question: "What is the sum of the first 10 positive integers?",
options: ["45", "55", "65"],
correct: 1,
response: "Right! The sum 1+2+...+10 = 55."
}, {
question: "Which scientist is famous for the uncertainty principle?",
options: ["Schrödinger", "Heisenberg", "Bohr"],
correct: 1,
response: "Excellent! Heisenberg formulated the uncertainty principle."
}, {
question: "What is the most widely used version control system?",
options: ["SVN", "Git", "Mercurial"],
correct: 1,
response: "Correct! Git is the most widely used version control system."
}, {
question: "Final challenge: In machine learning, what does 'overfitting' mean?",
options: ["Model performs well on training but poorly on new data", "Model has too few parameters", "Model trains too slowly"],
correct: 0,
response: "Outstanding! You've mastered all 100 questions! Overfitting occurs when a model memorizes training data but fails to generalize. You're a true Chat Quest champion!"
}];
var questionsTurkish = [{
question: "x²'nin x'e göre türevi nedir?",
options: ["x", "2x", "x²"],
correct: 1,
response: "Mükemmel! x²'nin türevi gerçekten de 2x'tir."
}, {
question: "Hangi programlama paradigması değişmezliği vurgular?",
options: ["Nesne yönelimli", "Fonksiyonel", "Prosedürel"],
correct: 1,
response: "Doğru! Fonksiyonel programlama değişmezliği vurgular."
}, {
question: "İkili aramanın zaman karmaşıklığı nedir?",
options: ["O(n)", "O(log n)", "O(n²)"],
correct: 1,
response: "Mükemmel! İkili aramanın zaman karmaşıklığı O(log n)'dir."
}, {
question: "Hangi elementin atom numarası 79'dur?",
options: ["Gümüş", "Altın", "Platin"],
correct: 1,
response: "Doğru! Altının atom numarası 79'dur."
}, {
question: "HTTP ne anlama gelir?",
options: ["HyperText Transfer Protocol", "High Transfer Text Protocol", "HyperText Transmission Protocol"],
correct: 0,
response: "Mükemmel! HTTP HyperText Transfer Protocol'dür."
}, {
question: "Kuantum fiziğinde Schrödinger'in kedisi neyin örneğidir?",
options: ["Dalga-parçacık ikiliği", "Kuantum süperpozisyonu", "Kuantum dolanıklığı"],
correct: 1,
response: "Doğru! Kuantum süperpozisyonunu gösterir."
}, {
question: "144'ün karekökü nedir?",
options: ["11", "12", "13"],
correct: 1,
response: "Mükemmel! √144 = 12."
}, {
question: "Hangi veri yapısı LIFO prensibini kullanır?",
options: ["Kuyruk", "Yığın", "Dizi"],
correct: 1,
response: "Doğru! Yığın Son Giren İlk Çıkar (LIFO) kullanır."
}, {
question: "Avustralya'nın başkenti neresidir?",
options: ["Sidney", "Melbourne", "Canberra"],
correct: 2,
response: "Doğru! Canberra Avustralya'nın başkentidir."
}, {
question: "Satrançta tahtada kaç kare vardır?",
options: ["64", "81", "49"],
correct: 0,
response: "Mükemmel! Satranç tahtasında 64 kare vardır."
}, {
question: "Suyun kimyasal formülü nedir?",
options: ["H2O", "CO2", "NaCl"],
correct: 0,
response: "Mükemmel! Su H2O'dur."
}, {
question: "Hangi sıralama algoritması en iyi ortalama durum zaman karmaşıklığına sahiptir?",
options: ["Kabarcık Sıralama", "Hızlı Sıralama", "Seçim Sıralama"],
correct: 1,
response: "Doğru! Hızlı Sıralama O(n log n) ortalama duruma sahiptir."
}, {
question: "200'ün %15'i nedir?",
options: ["25", "30", "35"],
correct: 1,
response: "Doğru! 200'ün %15'i 30'dur."
}, {
question: "İkinci Dünya Savaşı hangi yılda sona erdi?",
options: ["1944", "1945", "1946"],
correct: 1,
response: "Doğru! İkinci Dünya Savaşı 1945'te sona erdi."
}, {
question: "Güneş sistemimizdeki en büyük gezegen hangisidir?",
options: ["Satürn", "Jüpiter", "Neptün"],
correct: 1,
response: "Mükemmel! Jüpiter en büyük gezegendir."
}, {
question: "MongoDB hangi tür veritabanıdır?",
options: ["İlişkisel", "NoSQL", "Graf"],
correct: 1,
response: "Doğru! MongoDB bir NoSQL veritabanıdır."
}, {
question: "1/x dx'nin integrali nedir?",
options: ["x", "ln|x|", "1/x²"],
correct: 1,
response: "Mükemmel! 1/x'in integrali ln|x| + C'dir."
}, {
question: "Hangi ülkede en fazla saat dilimi vardır?",
options: ["ABD", "Rusya", "Çin"],
correct: 1,
response: "Doğru! Rusya'da 11 saat dilimi vardır."
}, {
question: "CPU ne anlama gelir?",
options: ["Central Processing Unit", "Computer Processing Unit", "Central Program Unit"],
correct: 0,
response: "Mükemmel! CPU Central Processing Unit'tir."
}, {
question: "İkili sistemde 1010 nedir?",
options: ["8", "10", "12"],
correct: 1,
response: "Doğru! İkili 1010 ondalık 10'a eşittir."
}, {
question: "'1984'ü kim yazdı?",
options: ["Aldous Huxley", "George Orwell", "Ray Bradbury"],
correct: 1,
response: "Mükemmel! George Orwell '1984'ü yazdı."
}, {
question: "Vakumdaki ışık hızı nedir?",
options: ["299,792,458 m/s", "300,000,000 m/s", "299,000,000 m/s"],
correct: 0,
response: "Mükemmel! Işık vakumda 299,792,458 m/s hızla gider."
}, {
question: "Güvenli web tarama için hangi protokol kullanılır?",
options: ["HTTP", "HTTPS", "FTP"],
correct: 1,
response: "Doğru! HTTPS güvenli web tarama için kullanılır."
}, {
question: "Dairenin alanı formülü nedir?",
options: ["πr", "πr²", "2πr"],
correct: 1,
response: "Mükemmel! Daire alanı πr²'dir."
}, {
question: "Hangi programlama dili Guido van Rossum tarafından oluşturulmuştur?",
options: ["Java", "Python", "Ruby"],
correct: 1,
response: "Doğru! Python Guido van Rossum tarafından oluşturulmuştur."
}, {
question: "Suyun deniz seviyesindeki kaynama noktası nedir?",
options: ["90°C", "100°C", "110°C"],
correct: 1,
response: "Doğru! Su deniz seviyesinde 100°C'de kaynar."
}, {
question: "Ağ iletişiminde DNS ne anlama gelir?",
options: ["Domain Name System", "Data Network Service", "Dynamic Name Server"],
correct: 0,
response: "Mükemmel! DNS Domain Name System'dir."
}, {
question: "2³'ün sonucu nedir?",
options: ["6", "8", "9"],
correct: 1,
response: "Mükemmel! 2³ = 8."
}, {
question: "Hangi kıtada en fazla ülke vardır?",
options: ["Asya", "Afrika", "Avrupa"],
correct: 1,
response: "Doğru! Afrika'da 54 ülke vardır."
}, {
question: "RAM ne anlama gelir?",
options: ["Random Access Memory", "Read Access Memory", "Rapid Access Memory"],
correct: 0,
response: "Doğru! RAM Random Access Memory'dir."
}, {
question: "Fizikte kuvvetin birimi nedir?",
options: ["Joule", "Newton", "Watt"],
correct: 1,
response: "Mükemmel! Kuvvet Newton ile ölçülür."
}, {
question: "Dünya'daki en büyük okyanus hangisidir?",
options: ["Atlantik", "Pasifik", "Hint"],
correct: 1,
response: "Doğru! Pasifik Okyanusu en büyüğüdür."
}, {
question: "Web stillemesi için öncelikle hangi dil kullanılır?",
options: ["HTML", "CSS", "JavaScript"],
correct: 1,
response: "Mükemmel! CSS web stillemesi için kullanılır."
}, {
question: "π (pi) değeri 2 ondalık basamakta nedir?",
options: ["3.14", "3.15", "3.16"],
correct: 0,
response: "Doğru! π ≈ 3.14."
}, {
question: "Mona Lisa'yı kim çizdi?",
options: ["Michelangelo", "Leonardo da Vinci", "Raphael"],
correct: 1,
response: "Mükemmel! Leonardo da Vinci Mona Lisa'yı çizdi."
}, {
question: "Demirin kimyasal sembolü nedir?",
options: ["I", "Fe", "Ir"],
correct: 1,
response: "Doğru! Demirin kimyasal sembolü Fe'dir."
}, {
question: "Nesne yönelimli programlamada kalıtım neye izin verir?",
options: ["Kod yeniden kullanımı", "Veri gizleme", "Polimorfizm"],
correct: 0,
response: "Mükemmel! Kalıtım kod yeniden kullanımına izin verir."
}, {
question: "En küçük asal sayı nedir?",
options: ["1", "2", "3"],
correct: 1,
response: "Doğru! 2 en küçük asal sayıdır."
}, {
question: "Hangi gezegen Kızıl Gezegen olarak bilinir?",
options: ["Venüs", "Mars", "Jüpiter"],
correct: 1,
response: "Mükemmel! Mars Kızıl Gezegen olarak bilinir."
}, {
question: "SQL ne anlama gelir?",
options: ["Structured Query Language", "Simple Query Language", "Standard Query Language"],
correct: 0,
response: "Doğru! SQL Structured Query Language'dir."
}, {
question: "7 × 8 kaçtır?",
options: ["54", "56", "58"],
correct: 1,
response: "Mükemmel! 7 × 8 = 56."
}, {
question: "Dünya'nın atmosferinin çoğunu hangi gaz oluşturur?",
options: ["Oksijen", "Azot", "Karbondioksit"],
correct: 1,
response: "Doğru! Azot atmosferin yaklaşık %78'ini oluşturur."
}, {
question: "World Wide Web hangi yılda icat edildi?",
options: ["1989", "1991", "1993"],
correct: 0,
response: "Mükemmel! WWW 1989'da icat edildi."
}, {
question: "Japonya'nın başkenti neresidir?",
options: ["Osaka", "Tokyo", "Kyoto"],
correct: 1,
response: "Doğru! Tokyo Japonya'nın başkentidir."
}, {
question: "Hangi veri türü doğru/yanlış değerlerini saklar?",
options: ["Tamsayı", "Boolean", "Metin"],
correct: 1,
response: "Mükemmel! Boolean doğru/yanlış değerlerini saklar."
}, {
question: "Suyun Fahrenheit'teki donma noktası nedir?",
options: ["30°F", "32°F", "34°F"],
correct: 1,
response: "Doğru! Su 32°F'de donar."
}, {
question: "Görelilik teorisini kim geliştirdi?",
options: ["Newton", "Einstein", "Galileo"],
correct: 1,
response: "Mükemmel! Albert Einstein görelilik teorisini geliştirdi."
}, {
question: "Dünyadaki en uzun nehir hangisidir?",
options: ["Amazon", "Nil", "Yangtze"],
correct: 1,
response: "Doğru! Nil en uzun nehirdir."
}, {
question: "Programlamada özyineleme nedir?",
options: ["Bir döngü", "Bir fonksiyonun kendisini çağırması", "Hata yönetimi"],
correct: 1,
response: "Mükemmel! Özyineleme bir fonksiyonun kendisini çağırmasıdır."
}, {
question: "144 ÷ 12 kaçtır?",
options: ["11", "12", "13"],
correct: 1,
response: "Doğru! 144 ÷ 12 = 12."
}, {
question: "Hangi vitamin güneş ışığına maruz kalma ile üretilir?",
options: ["Vitamin C", "Vitamin D", "Vitamin K"],
correct: 1,
response: "Mükemmel! Vitamin D güneş ışığı ile üretilir."
}, {
question: "API ne anlama gelir?",
options: ["Application Programming Interface", "Advanced Programming Interface", "Automated Programming Interface"],
correct: 0,
response: "Doğru! API Application Programming Interface'dir."
}, {
question: "Üçgende açıların toplamı nedir?",
options: ["180°", "360°", "90°"],
correct: 0,
response: "Mükemmel! Üçgen açıları 180°'ye toplanır."
}, {
question: "Hangi elementin sembolü 'O'dur?",
options: ["Altın", "Oksijen", "Gümüş"],
correct: 1,
response: "Doğru! 'O' Oksijen'in sembolüdür."
}, {
question: "Veritabanlarında CRUD ne anlama gelir?",
options: ["Create Read Update Delete", "Copy Read Update Delete", "Create Retrieve Update Delete"],
correct: 0,
response: "Mükemmel! CRUD Create, Read, Update, Delete'tir."
}, {
question: "3'ün küpü nedir?",
options: ["9", "27", "81"],
correct: 1,
response: "Doğru! 3³ = 27."
}, {
question: "Avrupa ve Amerika arasında hangi okyanus vardır?",
options: ["Pasifik", "Atlantik", "Hint"],
correct: 1,
response: "Mükemmel! Atlantik Okyanusu Avrupa ve Amerika arasındadır."
}, {
question: "HTML ne anlama gelir?",
options: ["HyperText Markup Language", "High Tech Modern Language", "HyperText Modern Language"],
correct: 0,
response: "Doğru! HTML HyperText Markup Language'dir."
}, {
question: "9'un karesi nedir?",
options: ["18", "81", "72"],
correct: 1,
response: "Mükemmel! 9² = 81."
}, {
question: "Bilgisayarların babası olarak kim bilinir?",
options: ["Alan Turing", "Charles Babbage", "John von Neumann"],
correct: 1,
response: "Doğru! Charles Babbage bilgisayarların babası olarak adlandırılır."
}, {
question: "Sofra tuzunun kimyasal formülü nedir?",
options: ["NaCl", "KCl", "CaCl2"],
correct: 0,
response: "Mükemmel! Sofra tuzu NaCl'dir (sodyum klorür)."
}, {
question: "Atmosferin hangi katmanında yaşıyoruz?",
options: ["Stratosfer", "Troposfer", "Mezosfer"],
correct: 1,
response: "Doğru! Troposferde yaşıyoruz."
}, {
question: "JSON ne anlama gelir?",
options: ["JavaScript Object Notation", "Java Standard Object Notation", "JavaScript Oriented Notation"],
correct: 0,
response: "Mükemmel! JSON JavaScript Object Notation'dır."
}, {
question: "80'in %25'i nedir?",
options: ["15", "20", "25"],
correct: 1,
response: "Doğru! 80'in %25'i 20'dir."
}, {
question: "Hangi alet atmosfer basıncını ölçer?",
options: ["Termometre", "Barometre", "Higrometre"],
correct: 1,
response: "Mükemmel! Barometre atmosfer basıncını ölçer."
}, {
question: "Yaşamın temel birimi nedir?",
options: ["Doku", "Hücre", "Organ"],
correct: 1,
response: "Doğru! Hücre yaşamın temel birimidir."
}, {
question: "Ağ iletişiminde IP adresi nedir?",
options: ["Internet Protocol address", "Internal Program address", "Internet Program address"],
correct: 0,
response: "Mükemmel! IP Internet Protocol anlamına gelir."
}, {
question: "6! (6 faktöriyel) sonucu nedir?",
options: ["36", "720", "120"],
correct: 1,
response: "Doğru! 6! = 720."
}, {
question: "Sahra Çölü hangi kıtada yer alır?",
options: ["Asya", "Afrika", "Avustralya"],
correct: 1,
response: "Mükemmel! Sahra Çölü Afrika'dadır."
}, {
question: "CSS ne anlama gelir?",
options: ["Computer Style Sheets", "Cascading Style Sheets", "Creative Style Sheets"],
correct: 1,
response: "Doğru! CSS Cascading Style Sheets'tir."
}, {
question: "Dünya'dan Güneş'e olan mesafeye ne denir?",
options: ["Işık yılı", "Astronomik Birim", "Parsek"],
correct: 1,
response: "Mükemmel! Astronomik Birim (AU) denir."
}, {
question: "Matematikte e (Euler sayısı) değeri yaklaşık nedir?",
options: ["2.718", "3.14", "1.618"],
correct: 0,
response: "Doğru! Euler sayısı e ≈ 2.718."
}, {
question: "Hangi programlama paradigması nesneler ve sınıflara odaklanır?",
options: ["Fonksiyonel", "Nesne yönelimli", "Prosedürel"],
correct: 1,
response: "Mükemmel! Nesne yönelimli programlama nesneler ve sınıflara odaklanır."
}, {
question: "En sert doğal madde nedir?",
options: ["Altın", "Elmas", "Demir"],
correct: 1,
response: "Doğru! Elmas en sert doğal maddedir."
}, {
question: "Fizikte entropi neyin ölçüsüdür?",
options: ["Enerji", "Düzensizlik", "Sıcaklık"],
correct: 1,
response: "Mükemmel! Entropi bir sistemdeki düzensizliği ölçer."
}, {
question: "Ondalık 5'in ikili karşılığı nedir?",
options: ["101", "110", "100"],
correct: 0,
response: "Doğru! Ondalık 5 ikili sistemde 101'dir."
}, {
question: "Mount Everest hangi dağ silsilesinde yer alır?",
options: ["And Dağları", "Himalayalar", "Alpler"],
correct: 1,
response: "Mükemmel! Mount Everest Himalayalar'dadır."
}, {
question: "GPU ne anlama gelir?",
options: ["General Processing Unit", "Graphics Processing Unit", "Global Processing Unit"],
correct: 1,
response: "Doğru! GPU Graphics Processing Unit'tir."
}, {
question: "Yatay bir doğrunun eğimi nedir?",
options: ["1", "0", "Tanımsız"],
correct: 1,
response: "Mükemmel! Yatay doğrunun eğimi 0'dır."
}, {
question: "Gezegen hareket yasalarını hangi bilim insanı önerdi?",
options: ["Galileo", "Kepler", "Kopernik"],
correct: 1,
response: "Doğru! Johannes Kepler gezegen hareket yasalarını önerdi."
}, {
question: "Evrendeki en bol bulunan gaz nedir?",
options: ["Oksijen", "Hidrojen", "Helyum"],
correct: 1,
response: "Mükemmel! Hidrojen evrendeki en bol gazdır."
}, {
question: "Bilgisayar biliminde Big O notasyonu ne için kullanılır?",
options: ["Kod organizasyonu", "Algoritma karmaşıklığı", "Veri depolama"],
correct: 1,
response: "Doğru! Big O notasyonu algoritma karmaşıklığını tanımlar."
}, {
question: "Kabartma tozunun kimyasal adı nedir?",
options: ["Sodyum klorür", "Sodyum bikarbonat", "Sodyum karbonat"],
correct: 1,
response: "Mükemmel! Kabartma tozu sodyum bikarbonattır."
}, {
question: "Öncelik kuyruğu uygulamak için hangi veri yapısı en iyidir?",
options: ["Dizi", "Yığın", "Stack"],
correct: 1,
response: "Doğru! Yığın öncelik kuyrukları için idealdir."
}, {
question: "Hücrenin enerji santrali nedir?",
options: ["Çekirdek", "Mitokondri", "Ribozom"],
correct: 1,
response: "Mükemmel! Mitokondri hücrenin enerji santralidir."
}, {
question: "Ağ iletişiminde HTTP, OSI modelinin hangi katmanında çalışır?",
options: ["Katman 6", "Katman 7", "Katman 5"],
correct: 1,
response: "Doğru! HTTP Katman 7'de (Uygulama katmanı) çalışır."
}, {
question: "1000'in 10 tabanında logaritması nedir?",
options: ["2", "3", "4"],
correct: 1,
response: "Mükemmel! log₁₀(1000) = 3."
}, {
question: "Hangi programlama dili 'bir kez yaz, her yerde çalıştır' ile bilinir?",
options: ["C++", "Java", "Python"],
correct: 1,
response: "Doğru! Java 'bir kez yaz, her yerde çalıştır' ile bilinir."
}, {
question: "Deprem çalışmasına ne denir?",
options: ["Jeoloji", "Sismoloji", "Meteoroloji"],
correct: 1,
response: "Mükemmel! Sismoloji deprem çalışmasıdır."
}, {
question: "Matematikte irrasyonel sayı nedir?",
options: ["Negatif sayı", "Kesir olarak ifade edilemeyen sayı", "Karmaşık sayı"],
correct: 1,
response: "Doğru! İrrasyonel sayı basit kesir olarak ifade edilemez."
}, {
question: "Yazılım mimarisinde MVC ne anlama gelir?",
options: ["Model View Controller", "Multiple View Controller", "Model Variable Controller"],
correct: 0,
response: "Mükemmel! MVC Model-View-Controller'dır."
}, {
question: "Bilgisayar belleğinin en küçük birimi nedir?",
options: ["Bayt", "Bit", "Kilobayt"],
correct: 1,
response: "Doğru! Bit bilgisayar belleğinin en küçük birimidir."
}, {
question: "Gezegenleri Güneş etrafında yörüngede tutan kuvvet nedir?",
options: ["Manyetik kuvvet", "Yerçekimi kuvveti", "Nükleer kuvvet"],
correct: 1,
response: "Mükemmel! Yerçekimi kuvveti gezegenleri yörüngede tutar."
}, {
question: "Hash tablosunda bir elemente erişimin zaman karmaşıklığı nedir (ortalama durum)?",
options: ["O(1)", "O(log n)", "O(n)"],
correct: 0,
response: "Doğru! Hash tablosu erişimi ortalamada O(1)'dir."
}, {
question: "Kanada'nın başkenti neresidir?",
options: ["Toronto", "Ottawa", "Vancouver"],
correct: 1,
response: "Mükemmel! Ottawa Kanada'nın başkentidir."
}, {
question: "Kimyada saf suyun pH'ı nedir?",
options: ["6", "7", "8"],
correct: 1,
response: "Doğru! Saf suyun pH'ı 7'dir (nötr)."
}, {
question: "Programlamada IDE ne anlama gelir?",
options: ["Integrated Development Environment", "Interactive Development Environment", "Internal Development Environment"],
correct: 0,
response: "Mükemmel! IDE Integrated Development Environment'tır."
}, {
question: "İlk 10 pozitif tamsayının toplamı nedir?",
options: ["45", "55", "65"],
correct: 1,
response: "Doğru! 1+2+...+10 toplamı 55'tir."
}, {
question: "Belirsizlik ilkesi ile ünlü bilim insanı kimdir?",
options: ["Schrödinger", "Heisenberg", "Bohr"],
correct: 1,
response: "Mükemmel! Heisenberg belirsizlik ilkesini formüle etti."
}, {
question: "En yaygın kullanılan versiyon kontrol sistemi nedir?",
options: ["SVN", "Git", "Mercurial"],
correct: 1,
response: "Doğru! Git en yaygın kullanılan versiyon kontrol sistemidir."
}, {
question: "Son meydan okuma: Makine öğreniminde 'overfitting' ne demektir?",
options: ["Model eğitimde iyi ama yeni veride kötü performans gösterir", "Modelin çok az parametresi vardır", "Model çok yavaş eğitim alır"],
correct: 0,
response: "Olağanüstü! 100 soruyu da başardınız! Overfitting bir modelin eğitim verisini ezberlediği ama genelleme yapamadığı durumdur. Gerçek bir Chat Quest şampiyonusunuz!"
}];
var questions = questionsEnglish;
game.addChild(messagesContainer);
game.addChild(optionsContainer);
game.addChild(menuContainer);
game.addChild(settingsContainer);
// Main menu elements
var titleText = new Text2('Chat Quest', {
size: 120,
fill: 0x4a9eff
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
menuContainer.addChild(titleText);
var subtitleText = new Text2('AI Assistant Adventure', {
size: 60,
fill: 0x666666
});
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 950;
menuContainer.addChild(subtitleText);
var playButton = new MenuButton('PLAY', function () {
startGame();
});
playButton.x = 1024;
playButton.y = 1300;
menuContainer.addChild(playButton);
var settingsButton = new SettingsButton('SETTINGS', function () {
showSettings();
});
settingsButton.x = 1024;
settingsButton.y = 1500;
menuContainer.addChild(settingsButton);
// Settings menu elements
var settingsTitleText = new Text2('Settings', {
size: 100,
fill: 0x4a9eff
});
settingsTitleText.anchor.set(0.5, 0.5);
settingsTitleText.x = 1024;
settingsTitleText.y = 600;
settingsContainer.addChild(settingsTitleText);
var soundToggleButton = new SettingsButton('Sound: ON', function () {
toggleSound();
});
soundToggleButton.x = 1024;
soundToggleButton.y = 1000;
settingsContainer.addChild(soundToggleButton);
var difficultyButton = new SettingsButton('Difficulty: Normal', function () {
cycleDifficulty();
});
difficultyButton.x = 1024;
difficultyButton.y = 1200;
settingsContainer.addChild(difficultyButton);
var languageButton = new SettingsButton('Language: English', function () {
toggleLanguage();
});
languageButton.x = 1024;
languageButton.y = 1400;
settingsContainer.addChild(languageButton);
var backButton = new SettingsButton('BACK', function () {
showMenu();
});
backButton.x = 1024;
backButton.y = 1600;
settingsContainer.addChild(backButton);
function showMenu() {
gamePhase = 'menu';
menuContainer.visible = true;
messagesContainer.visible = false;
optionsContainer.visible = false;
settingsContainer.visible = false;
scoreTxt.visible = false;
aiAvatar.visible = false;
}
function startGame() {
gamePhase = 'category';
menuContainer.visible = false;
settingsContainer.visible = false;
showCategorySelection();
}
function showCategorySelection() {
// Create category selection container
var categoryContainer = new Container();
game.addChild(categoryContainer);
var categoryTitleText = new Text2(currentLanguage === 'turkish' ? 'Kategori Seçin' : 'Choose Category', {
size: 100,
fill: 0x4a9eff
});
categoryTitleText.anchor.set(0.5, 0.5);
categoryTitleText.x = 1024;
categoryTitleText.y = 800;
categoryContainer.addChild(categoryTitleText);
var historyButton = new MenuButton(currentLanguage === 'turkish' ? 'TARİH' : 'HISTORY', function () {
startGameWithCategory('history');
categoryContainer.destroy();
});
historyButton.x = 1024;
historyButton.y = 1200;
categoryContainer.addChild(historyButton);
var scienceButton = new MenuButton(currentLanguage === 'turkish' ? 'BİLİM & MATEMATİK' : 'SCIENCE & MATH', function () {
startGameWithCategory('science');
categoryContainer.destroy();
});
scienceButton.x = 1024;
scienceButton.y = 1400;
categoryContainer.addChild(scienceButton);
var expertButton = new MenuButton(currentLanguage === 'turkish' ? 'UZMAN (TÜMÜ)' : 'EXPERT (ALL)', function () {
startGameWithCategory('expert');
categoryContainer.destroy();
});
expertButton.x = 1024;
expertButton.y = 1600;
categoryContainer.addChild(expertButton);
}
function startGameWithCategory(category) {
gamePhase = 'intro';
messagesContainer.visible = true;
optionsContainer.visible = true;
scoreTxt.visible = true;
aiAvatar.visible = true;
// Reset game state
chatMessages = [];
currentQuestion = 0;
score = 0;
scrollOffset = 0;
scoreTxt.setText(currentLanguage === 'turkish' ? 'Puan: 0' : 'Score: 0');
messagesContainer.y = 0;
messagesContainer.removeChildren();
optionsContainer.removeChildren();
// Filter questions based on category
var filteredQuestions = [];
var baseQuestions = currentLanguage === 'turkish' ? questionsTurkish : questionsEnglish;
if (category === 'history') {
// History questions (indices that contain historical content)
var historyIndices = [8, 13, 17, 20, 34, 41, 46, 67];
for (var i = 0; i < historyIndices.length; i++) {
if (baseQuestions[historyIndices[i]]) {
filteredQuestions.push(baseQuestions[historyIndices[i]]);
}
}
} else if (category === 'science') {
// Science and math questions
var scienceIndices = [0, 2, 3, 5, 6, 11, 16, 21, 23, 26, 30, 31, 33, 36, 38, 49, 51, 52, 60, 69, 77, 81, 85, 91, 95];
for (var i = 0; i < scienceIndices.length; i++) {
if (baseQuestions[scienceIndices[i]]) {
filteredQuestions.push(baseQuestions[scienceIndices[i]]);
}
}
} else {
// Expert mode - all questions
filteredQuestions = baseQuestions.slice();
}
questions = filteredQuestions;
// Start the game introduction
LK.setTimeout(function () {
var welcomeMsg = currentLanguage === 'turkish' ? "Sohbet Macerası'na hoş geldiniz! Ben sizin arkadaş canlısı yapay zeka asistanınızım." : "Welcome to Chat Quest! I'm your friendly AI assistant.";
addChatMessage(welcomeMsg, true);
LK.setTimeout(function () {
var categoryMsg = '';
if (category === 'history') {
categoryMsg = currentLanguage === 'turkish' ? "Tarih kategorisini seçtiniz. Size tarih soruları soracağım!" : "You've chosen History category. I'll ask you history questions!";
} else if (category === 'science') {
categoryMsg = currentLanguage === 'turkish' ? "Bilim & Matematik kategorisini seçtiniz. Bilimsel sorular geliyor!" : "You've chosen Science & Math category. Scientific questions coming up!";
} else {
categoryMsg = currentLanguage === 'turkish' ? "Uzman modunu seçtiniz. En zor sorular sizi bekliyor!" : "You've chosen Expert mode. The toughest questions await you!";
}
addChatMessage(categoryMsg, true);
LK.setTimeout(function () {
askQuestion(0);
}, 1500);
}, 2000);
}, 1000);
}
function showSettings() {
gamePhase = 'settings';
menuContainer.visible = false;
settingsContainer.visible = true;
messagesContainer.visible = false;
optionsContainer.visible = false;
scoreTxt.visible = false;
aiAvatar.visible = false;
}
function toggleSound() {
soundEnabled = !soundEnabled;
var soundText;
if (currentLanguage === 'turkish') {
soundText = soundEnabled ? 'Ses: AÇIK' : 'Ses: KAPALI';
} else {
soundText = soundEnabled ? 'Sound: ON' : 'Sound: OFF';
}
soundToggleButton.children[1].setText(soundText);
}
function cycleDifficulty() {
if (difficulty === 'Easy') {
difficulty = 'Normal';
} else if (difficulty === 'Normal') {
difficulty = 'Hard';
} else {
difficulty = 'Easy';
}
var difficultyText = 'Difficulty: ' + difficulty;
difficultyButton.children[1].setText(difficultyText);
}
function toggleLanguage() {
if (currentLanguage === 'english') {
currentLanguage = 'turkish';
questions = questionsTurkish;
languageButton.children[1].setText('Dil: Türkçe');
// Update other Turkish UI elements
titleText.setText('Sohbet Macerası');
subtitleText.setText('Yapay Zeka Asistan Macerası');
playButton.children[1].setText('OYNA');
settingsButton.children[1].setText('AYARLAR');
settingsTitleText.setText('Ayarlar');
soundToggleButton.children[1].setText(soundEnabled ? 'Ses: AÇIK' : 'Ses: KAPALI');
difficultyButton.children[1].setText('Zorluk: ' + (difficulty === 'Easy' ? 'Kolay' : difficulty === 'Normal' ? 'Normal' : 'Zor'));
backButton.children[1].setText('GERİ');
} else {
currentLanguage = 'english';
questions = questionsEnglish;
languageButton.children[1].setText('Language: English');
// Update English UI elements
titleText.setText('Chat Quest');
subtitleText.setText('AI Assistant Adventure');
playButton.children[1].setText('PLAY');
settingsButton.children[1].setText('SETTINGS');
settingsTitleText.setText('Settings');
soundToggleButton.children[1].setText(soundEnabled ? 'Sound: ON' : 'Sound: OFF');
difficultyButton.children[1].setText('Difficulty: ' + difficulty);
backButton.children[1].setText('BACK');
}
}
// Score display
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0x4A9EFF
});
scoreTxt.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreTxt);
// AI Avatar
var aiAvatar = game.addChild(LK.getAsset('aiAvatar', {
anchorX: 0.5,
anchorY: 0.5,
x: 150,
y: 200
}));
// Pulsing animation for AI avatar
tween(aiAvatar, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(aiAvatar, {
scaleX: 1,
scaleY: 1
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
// Restart the pulsing animation
if (aiAvatar.parent) {
tween(aiAvatar, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: arguments.callee.caller
});
}
}
});
}
});
function addChatMessage(message, isAI) {
var yPos = 300;
if (chatMessages.length > 0) {
var lastMessage = chatMessages[chatMessages.length - 1];
yPos = lastMessage.y + lastMessage.getBubbleHeight() + 30;
}
var newMessage = new ChatMessage(message, isAI, yPos);
messagesContainer.addChild(newMessage);
chatMessages.push(newMessage);
// Auto-scroll if needed
if (yPos > 1800) {
scrollOffset = yPos - 1800;
messagesContainer.y = -scrollOffset;
}
// Animate message appearance
newMessage.alpha = 0;
newMessage.scaleX = 0.8;
newMessage.scaleY = 0.8;
tween(newMessage, {
alpha: 1,
scaleX: 1,
scaleY: 1
}, {
duration: 300,
easing: tween.easeOut
});
if (soundEnabled) {
LK.getSound('messageSound').play();
}
}
function showOptions(optionTexts, callbacks) {
// Clear existing options
for (var i = optionsContainer.children.length - 1; i >= 0; i--) {
optionsContainer.removeChild(optionsContainer.children[i]);
}
for (var i = 0; i < optionTexts.length; i++) {
var option = new OptionButton(optionTexts[i], callbacks[i]);
option.x = 1024;
option.y = 2200 + i * 180;
optionsContainer.addChild(option);
// Animate options sliding up
tween(option, {
y: 2200 - i * 180
}, {
duration: 400,
easing: tween.easeOut
});
}
}
function hideOptions() {
for (var i = 0; i < optionsContainer.children.length; i++) {
var option = optionsContainer.children[i];
tween(option, {
y: 2800
}, {
duration: 300,
easing: tween.easeIn
});
}
}
function askQuestion(questionIndex) {
if (questionIndex >= questions.length) {
gamePhase = 'complete';
var completionMsg = currentLanguage === 'turkish' ? "Tebrikler! Sohbet Macerası'nı tamamladınız! Final puanınız " + score + " puan. Harikasınız!" : "Congratulations! You've completed Chat Quest! Your final score is " + score + " points. You're amazing!";
addChatMessage(completionMsg, true);
LK.setScore(score);
return;
}
var q = questions[questionIndex];
addChatMessage(q.question, true);
// Show options after a delay
LK.setTimeout(function () {
var callbacks = [];
for (var i = 0; i < q.options.length; i++) {
(function (index) {
callbacks.push(function () {
answerQuestion(index, questionIndex);
});
})(i);
}
showOptions(q.options, callbacks);
}, 1000);
}
function answerQuestion(selectedIndex, questionIndex) {
var q = questions[questionIndex];
hideOptions();
// Add user's answer
addChatMessage(q.options[selectedIndex], false);
LK.setTimeout(function () {
if (selectedIndex === q.correct) {
score += 10;
scoreTxt.setText((currentLanguage === 'turkish' ? 'Puan: ' : 'Score: ') + score);
addChatMessage(q.response, true);
if (soundEnabled) {
LK.getSound('correctSound').play();
}
// Flash screen green briefly
LK.effects.flashScreen(0x00ff00, 300);
} else {
var wrongMsg = currentLanguage === 'turkish' ? "Bu tam olarak doğru değil, ama merak etmeyin! Doğru cevap şuydu: " + q.options[q.correct] : "That's not quite right, but don't worry! The correct answer was: " + q.options[q.correct];
addChatMessage(wrongMsg, true);
if (soundEnabled) {
LK.getSound('wrongSound').play();
}
}
// Move to next question
LK.setTimeout(function () {
currentQuestion++;
askQuestion(currentQuestion);
}, 2000);
}, 1000);
}
// Touch handling for scrolling chat
var lastTouchY = 0;
var isDragging = false;
game.down = function (x, y, obj) {
lastTouchY = y;
isDragging = true;
};
game.move = function (x, y, obj) {
if (isDragging && chatMessages.length > 3) {
var deltaY = y - lastTouchY;
scrollOffset -= deltaY;
// Limit scrolling
if (scrollOffset < 0) scrollOffset = 0;
if (scrollOffset > maxScroll) scrollOffset = maxScroll;
messagesContainer.y = -scrollOffset;
lastTouchY = y;
}
};
game.up = function (x, y, obj) {
isDragging = false;
};
// Initialize the game
showMenu();
game.update = function () {
// Update max scroll based on chat content
if (chatMessages.length > 0) {
var lastMessage = chatMessages[chatMessages.length - 1];
maxScroll = Math.max(0, lastMessage.y + lastMessage.getBubbleHeight() - 1800);
}
}; ===================================================================
--- original.js
+++ change.js
@@ -1223,11 +1223,49 @@
scoreTxt.visible = false;
aiAvatar.visible = false;
}
function startGame() {
- gamePhase = 'intro';
+ gamePhase = 'category';
menuContainer.visible = false;
settingsContainer.visible = false;
+ showCategorySelection();
+}
+function showCategorySelection() {
+ // Create category selection container
+ var categoryContainer = new Container();
+ game.addChild(categoryContainer);
+ var categoryTitleText = new Text2(currentLanguage === 'turkish' ? 'Kategori Seçin' : 'Choose Category', {
+ size: 100,
+ fill: 0x4a9eff
+ });
+ categoryTitleText.anchor.set(0.5, 0.5);
+ categoryTitleText.x = 1024;
+ categoryTitleText.y = 800;
+ categoryContainer.addChild(categoryTitleText);
+ var historyButton = new MenuButton(currentLanguage === 'turkish' ? 'TARİH' : 'HISTORY', function () {
+ startGameWithCategory('history');
+ categoryContainer.destroy();
+ });
+ historyButton.x = 1024;
+ historyButton.y = 1200;
+ categoryContainer.addChild(historyButton);
+ var scienceButton = new MenuButton(currentLanguage === 'turkish' ? 'BİLİM & MATEMATİK' : 'SCIENCE & MATH', function () {
+ startGameWithCategory('science');
+ categoryContainer.destroy();
+ });
+ scienceButton.x = 1024;
+ scienceButton.y = 1400;
+ categoryContainer.addChild(scienceButton);
+ var expertButton = new MenuButton(currentLanguage === 'turkish' ? 'UZMAN (TÜMÜ)' : 'EXPERT (ALL)', function () {
+ startGameWithCategory('expert');
+ categoryContainer.destroy();
+ });
+ expertButton.x = 1024;
+ expertButton.y = 1600;
+ categoryContainer.addChild(expertButton);
+}
+function startGameWithCategory(category) {
+ gamePhase = 'intro';
messagesContainer.visible = true;
optionsContainer.visible = true;
scoreTxt.visible = true;
aiAvatar.visible = true;
@@ -1239,15 +1277,46 @@
scoreTxt.setText(currentLanguage === 'turkish' ? 'Puan: 0' : 'Score: 0');
messagesContainer.y = 0;
messagesContainer.removeChildren();
optionsContainer.removeChildren();
+ // Filter questions based on category
+ var filteredQuestions = [];
+ var baseQuestions = currentLanguage === 'turkish' ? questionsTurkish : questionsEnglish;
+ if (category === 'history') {
+ // History questions (indices that contain historical content)
+ var historyIndices = [8, 13, 17, 20, 34, 41, 46, 67];
+ for (var i = 0; i < historyIndices.length; i++) {
+ if (baseQuestions[historyIndices[i]]) {
+ filteredQuestions.push(baseQuestions[historyIndices[i]]);
+ }
+ }
+ } else if (category === 'science') {
+ // Science and math questions
+ var scienceIndices = [0, 2, 3, 5, 6, 11, 16, 21, 23, 26, 30, 31, 33, 36, 38, 49, 51, 52, 60, 69, 77, 81, 85, 91, 95];
+ for (var i = 0; i < scienceIndices.length; i++) {
+ if (baseQuestions[scienceIndices[i]]) {
+ filteredQuestions.push(baseQuestions[scienceIndices[i]]);
+ }
+ }
+ } else {
+ // Expert mode - all questions
+ filteredQuestions = baseQuestions.slice();
+ }
+ questions = filteredQuestions;
// Start the game introduction
LK.setTimeout(function () {
var welcomeMsg = currentLanguage === 'turkish' ? "Sohbet Macerası'na hoş geldiniz! Ben sizin arkadaş canlısı yapay zeka asistanınızım." : "Welcome to Chat Quest! I'm your friendly AI assistant.";
addChatMessage(welcomeMsg, true);
LK.setTimeout(function () {
- var readyMsg = currentLanguage === 'turkish' ? "Size eğlenceli sorular soracağım. Başlamaya hazır mısınız?" : "I'll ask you some fun questions. Are you ready to start?";
- addChatMessage(readyMsg, true);
+ var categoryMsg = '';
+ if (category === 'history') {
+ categoryMsg = currentLanguage === 'turkish' ? "Tarih kategorisini seçtiniz. Size tarih soruları soracağım!" : "You've chosen History category. I'll ask you history questions!";
+ } else if (category === 'science') {
+ categoryMsg = currentLanguage === 'turkish' ? "Bilim & Matematik kategorisini seçtiniz. Bilimsel sorular geliyor!" : "You've chosen Science & Math category. Scientific questions coming up!";
+ } else {
+ categoryMsg = currentLanguage === 'turkish' ? "Uzman modunu seçtiniz. En zor sorular sizi bekliyor!" : "You've chosen Expert mode. The toughest questions await you!";
+ }
+ addChatMessage(categoryMsg, true);
LK.setTimeout(function () {
askQuestion(0);
}, 1500);
}, 2000);