User prompt
now they are all dark
User prompt
when a button is clicked on one question, it should not be darkended for the next
User prompt
Please fix the bug: 'Uncaught TypeError: LK.effects.confetti is not a function' in or related to this line: 'LK.effects.confetti({' Line Number: 697
User prompt
can we make the UI more fun? Ideally some animations when you guess correct - like confetti
User prompt
okay. we need at least 100
Code edit (1 edits merged)
Please save this source code
User prompt
Game Studio Guessr
Initial prompt
Hi - i want to create a quiz game. It can pretty much be any format but the questions will be about guessing what studio made waht gaem
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
// OptionButton: A tappable answer button
var OptionButton = Container.expand(function () {
var self = Container.call(this);
// Button background
var bg = self.attachAsset('optionBg', {
width: 1200,
height: 180,
color: 0x2d2d2d,
shape: 'box',
anchorX: 0.5,
anchorY: 0.5
});
// Option text
var txt = new Text2('', {
size: 70,
fill: 0xFFFFFF
});
txt.anchor.set(0.5, 0.5);
self.addChild(txt);
// Store callback
self._onSelect = null;
// Set option text
self.setText = function (t) {
txt.setText(t);
};
// Set callback
self.setCallback = function (cb) {
self._onSelect = cb;
};
// Enable/disable button
self.setEnabled = function (enabled) {
self.interactive = enabled;
self.alpha = enabled ? 1 : 0.5;
};
// Handle tap
self.down = function (x, y, obj) {
if (self._onSelect) self._onSelect();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x181c24
});
/****
* Game Code
****/
// --- Quiz Data ---
var quizData = [{
game: "The Legend of Zelda: Breath of the Wild",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Rockstar Games", "Valve"]
}, {
game: "The Witcher 3: Wild Hunt",
studio: "CD Projekt Red",
options: ["CD Projekt Red", "Bethesda", "Square Enix", "Capcom"]
}, {
game: "Halo: Combat Evolved",
studio: "Bungie",
options: ["Bungie", "343 Industries", "EA", "Insomniac Games"]
}, {
game: "God of War (2018)",
studio: "Santa Monica Studio",
options: ["Santa Monica Studio", "Naughty Dog", "FromSoftware", "Remedy"]
}, {
game: "Grand Theft Auto V",
studio: "Rockstar North",
options: ["Rockstar North", "Ubisoft", "Valve", "Nintendo"]
}, {
game: "Overwatch",
studio: "Blizzard Entertainment",
options: ["Blizzard Entertainment", "Epic Games", "Valve", "Riot Games"]
}, {
game: "Portal 2",
studio: "Valve",
options: ["Valve", "Bethesda", "Ubisoft", "Nintendo"]
}, {
game: "Uncharted 4: A Thief's End",
studio: "Naughty Dog",
options: ["Naughty Dog", "Santa Monica Studio", "Rockstar Games", "CD Projekt Red"]
}, {
game: "Dark Souls",
studio: "FromSoftware",
options: ["FromSoftware", "Capcom", "Square Enix", "Remedy"]
}, {
game: "Red Dead Redemption 2",
studio: "Rockstar Games",
options: ["Rockstar Games", "Ubisoft", "Valve", "Nintendo"]
}, {
game: "Assassin's Creed II",
studio: "Ubisoft",
options: ["Ubisoft", "Rockstar Games", "Valve", "Nintendo"]
}, {
game: "Half-Life 2",
studio: "Valve",
options: ["Valve", "Bethesda", "Ubisoft", "CD Projekt Red"]
}, {
game: "The Last of Us",
studio: "Naughty Dog",
options: ["Naughty Dog", "Santa Monica Studio", "Rockstar Games", "Remedy"]
}, {
game: "Bloodborne",
studio: "FromSoftware",
options: ["FromSoftware", "Capcom", "Square Enix", "Remedy"]
}, {
game: "Mass Effect 2",
studio: "BioWare",
options: ["BioWare", "EA", "Ubisoft", "Bethesda"]
}, {
game: "Elden Ring",
studio: "FromSoftware",
options: ["FromSoftware", "Capcom", "Square Enix", "Remedy"]
}, {
game: "Cyberpunk 2077",
studio: "CD Projekt Red",
options: ["CD Projekt Red", "Bethesda", "Square Enix", "Capcom"]
}, {
game: "The Elder Scrolls V: Skyrim",
studio: "Bethesda",
options: ["Bethesda", "CD Projekt Red", "Ubisoft", "Valve"]
}, {
game: "DOOM (2016)",
studio: "id Software",
options: ["id Software", "Bethesda", "Valve", "Ubisoft"]
}, {
game: "Minecraft",
studio: "Mojang",
options: ["Mojang", "Epic Games", "Valve", "Nintendo"]
}, {
game: "Fortnite",
studio: "Epic Games",
options: ["Epic Games", "Riot Games", "Valve", "Ubisoft"]
}, {
game: "League of Legends",
studio: "Riot Games",
options: ["Riot Games", "Epic Games", "Valve", "Ubisoft"]
}, {
game: "Counter-Strike: Global Offensive",
studio: "Valve",
options: ["Valve", "Ubisoft", "EA", "Rockstar Games"]
}, {
game: "Animal Crossing: New Horizons",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
}, {
game: "Persona 5",
studio: "Atlus",
options: ["Atlus", "Square Enix", "Capcom", "Bandai Namco"]
}, {
game: "Final Fantasy VII",
studio: "Square Enix",
options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
}, {
game: "Street Fighter II",
studio: "Capcom",
options: ["Capcom", "Bandai Namco", "Square Enix", "Nintendo"]
}, {
game: "Tekken 3",
studio: "Bandai Namco",
options: ["Bandai Namco", "Capcom", "Square Enix", "Nintendo"]
}, {
game: "Pac-Man",
studio: "Namco",
options: ["Namco", "Nintendo", "Atari", "Sega"]
}, {
game: "Sonic the Hedgehog",
studio: "Sega",
options: ["Sega", "Nintendo", "Namco", "Capcom"]
}, {
game: "Tetris",
studio: "Alexey Pajitnov",
options: ["Alexey Pajitnov", "Nintendo", "Sega", "Atari"]
}, {
game: "Donkey Kong",
studio: "Nintendo",
options: ["Nintendo", "Sega", "Namco", "Capcom"]
}, {
game: "Metroid Prime",
studio: "Retro Studios",
options: ["Retro Studios", "Nintendo", "Capcom", "Ubisoft"]
}, {
game: "Splatoon",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
}, {
game: "Fire Emblem: Three Houses",
studio: "Intelligent Systems",
options: ["Intelligent Systems", "Nintendo", "Capcom", "Square Enix"]
}, {
game: "Pokémon Red and Blue",
studio: "Game Freak",
options: ["Game Freak", "Nintendo", "Capcom", "Bandai Namco"]
}, {
game: "Pokémon GO",
studio: "Niantic",
options: ["Niantic", "Nintendo", "Game Freak", "Bandai Namco"]
}, {
game: "Super Smash Bros. Ultimate",
studio: "Nintendo",
options: ["Nintendo", "Bandai Namco", "Capcom", "Ubisoft"]
}, {
game: "Mario Kart 8 Deluxe",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
}, {
game: "Super Mario Odyssey",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
}, {
game: "The Legend of Zelda: Ocarina of Time",
studio: "Nintendo",
options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
}, {
game: "The Sims",
studio: "Maxis",
options: ["Maxis", "EA", "Ubisoft", "Valve"]
}, {
game: "SimCity",
studio: "Maxis",
options: ["Maxis", "EA", "Ubisoft", "Valve"]
}, {
game: "Spore",
studio: "Maxis",
options: ["Maxis", "EA", "Ubisoft", "Valve"]
}, {
game: "FIFA 21",
studio: "EA Sports",
options: ["EA Sports", "Konami", "Ubisoft", "Valve"]
}, {
game: "Pro Evolution Soccer",
studio: "Konami",
options: ["Konami", "EA Sports", "Ubisoft", "Valve"]
}, {
game: "Silent Hill 2",
studio: "Konami",
options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
}, {
game: "Metal Gear Solid",
studio: "Konami",
options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
}, {
game: "Castlevania: Symphony of the Night",
studio: "Konami",
options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
}, {
game: "Resident Evil 2",
studio: "Capcom",
options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
}, {
game: "Monster Hunter: World",
studio: "Capcom",
options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
}, {
game: "Mega Man 2",
studio: "Capcom",
options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
}, {
game: "Dragon Quest XI",
studio: "Square Enix",
options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
}, {
game: "Kingdom Hearts",
studio: "Square Enix",
options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
}, {
game: "Chrono Trigger",
studio: "Square",
options: ["Square", "Enix", "Capcom", "Nintendo"]
}, {
game: "Persona 4 Golden",
studio: "Atlus",
options: ["Atlus", "Square Enix", "Capcom", "Bandai Namco"]
}, {
game: "Yakuza 0",
studio: "Sega",
options: ["Sega", "Capcom", "Square Enix", "Bandai Namco"]
}, {
game: "Bayonetta",
studio: "PlatinumGames",
options: ["PlatinumGames", "Sega", "Capcom", "Nintendo"]
}, {
game: "NieR: Automata",
studio: "PlatinumGames",
options: ["PlatinumGames", "Square Enix", "Capcom", "Nintendo"]
}, {
game: "Journey",
studio: "thatgamecompany",
options: ["thatgamecompany", "Santa Monica Studio", "Naughty Dog", "Remedy"]
}, {
game: "Flower",
studio: "thatgamecompany",
options: ["thatgamecompany", "Santa Monica Studio", "Naughty Dog", "Remedy"]
}, {
game: "Inside",
studio: "Playdead",
options: ["Playdead", "Remedy", "Naughty Dog", "Santa Monica Studio"]
}, {
game: "Limbo",
studio: "Playdead",
options: ["Playdead", "Remedy", "Naughty Dog", "Santa Monica Studio"]
}, {
game: "Control",
studio: "Remedy",
options: ["Remedy", "Playdead", "Naughty Dog", "Santa Monica Studio"]
}, {
game: "Alan Wake",
studio: "Remedy",
options: ["Remedy", "Playdead", "Naughty Dog", "Santa Monica Studio"]
}, {
game: "Max Payne",
studio: "Remedy",
options: ["Remedy", "Rockstar Games", "Naughty Dog", "Santa Monica Studio"]
}, {
game: "Grand Theft Auto: San Andreas",
studio: "Rockstar North",
options: ["Rockstar North", "Ubisoft", "Valve", "Nintendo"]
}, {
game: "Bully",
studio: "Rockstar Vancouver",
options: ["Rockstar Vancouver", "Rockstar North", "Ubisoft", "Valve"]
}, {
game: "L.A. Noire",
studio: "Team Bondi",
options: ["Team Bondi", "Rockstar North", "Ubisoft", "Valve"]
}, {
game: "Bioshock",
studio: "Irrational Games",
options: ["Irrational Games", "2K Games", "Ubisoft", "Valve"]
}, {
game: "Bioshock Infinite",
studio: "Irrational Games",
options: ["Irrational Games", "2K Games", "Ubisoft", "Valve"]
}, {
game: "Borderlands 2",
studio: "Gearbox Software",
options: ["Gearbox Software", "2K Games", "Ubisoft", "Valve"]
}, {
game: "Civilization VI",
studio: "Firaxis Games",
options: ["Firaxis Games", "2K Games", "Ubisoft", "Valve"]
}, {
game: "XCOM 2",
studio: "Firaxis Games",
options: ["Firaxis Games", "2K Games", "Ubisoft", "Valve"]
}, {
game: "Sid Meier's Pirates!",
studio: "MicroProse",
options: ["MicroProse", "Firaxis Games", "2K Games", "Ubisoft"]
}, {
game: "The Outer Worlds",
studio: "Obsidian Entertainment",
options: ["Obsidian Entertainment", "Bethesda", "CD Projekt Red", "BioWare"]
}, {
game: "Fallout: New Vegas",
studio: "Obsidian Entertainment",
options: ["Obsidian Entertainment", "Bethesda", "CD Projekt Red", "BioWare"]
}, {
game: "Fallout 3",
studio: "Bethesda",
options: ["Bethesda", "Obsidian Entertainment", "CD Projekt Red", "BioWare"]
}, {
game: "Dishonored",
studio: "Arkane Studios",
options: ["Arkane Studios", "Bethesda", "Obsidian Entertainment", "BioWare"]
}, {
game: "Prey (2017)",
studio: "Arkane Studios",
options: ["Arkane Studios", "Bethesda", "Obsidian Entertainment", "BioWare"]
}, {
game: "Wolfenstein: The New Order",
studio: "MachineGames",
options: ["MachineGames", "id Software", "Bethesda", "Obsidian Entertainment"]
}, {
game: "Quake",
studio: "id Software",
options: ["id Software", "Bethesda", "Obsidian Entertainment", "MachineGames"]
}, {
game: "Doom Eternal",
studio: "id Software",
options: ["id Software", "Bethesda", "Obsidian Entertainment", "MachineGames"]
}, {
game: "Cuphead",
studio: "Studio MDHR",
options: ["Studio MDHR", "Team Cherry", "Playdead", "Remedy"]
}, {
game: "Hollow Knight",
studio: "Team Cherry",
options: ["Team Cherry", "Studio MDHR", "Playdead", "Remedy"]
}, {
game: "Celeste",
studio: "Matt Makes Games",
options: ["Matt Makes Games", "Team Cherry", "Studio MDHR", "Playdead"]
}, {
game: "Undertale",
studio: "Toby Fox",
options: ["Toby Fox", "Matt Makes Games", "Team Cherry", "Studio MDHR"]
}, {
game: "Stardew Valley",
studio: "ConcernedApe",
options: ["ConcernedApe", "Toby Fox", "Matt Makes Games", "Team Cherry"]
}, {
game: "Terraria",
studio: "Re-Logic",
options: ["Re-Logic", "ConcernedApe", "Toby Fox", "Matt Makes Games"]
}, {
game: "Ori and the Blind Forest",
studio: "Moon Studios",
options: ["Moon Studios", "Re-Logic", "ConcernedApe", "Toby Fox"]
}, {
game: "Ori and the Will of the Wisps",
studio: "Moon Studios",
options: ["Moon Studios", "Re-Logic", "ConcernedApe", "Toby Fox"]
}, {
game: "Hades",
studio: "Supergiant Games",
options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
}, {
game: "Transistor",
studio: "Supergiant Games",
options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
}, {
game: "Bastion",
studio: "Supergiant Games",
options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
}, {
game: "Dead Cells",
studio: "Motion Twin",
options: ["Motion Twin", "Supergiant Games", "Moon Studios", "Re-Logic"]
}, {
game: "Slay the Spire",
studio: "MegaCrit",
options: ["MegaCrit", "Motion Twin", "Supergiant Games", "Moon Studios"]
}, {
game: "Into the Breach",
studio: "Subset Games",
options: ["Subset Games", "MegaCrit", "Motion Twin", "Supergiant Games"]
}, {
game: "FTL: Faster Than Light",
studio: "Subset Games",
options: ["Subset Games", "MegaCrit", "Motion Twin", "Supergiant Games"]
}, {
game: "The Binding of Isaac",
studio: "Edmund McMillen",
options: ["Edmund McMillen", "Subset Games", "MegaCrit", "Motion Twin"]
}, {
game: "Super Meat Boy",
studio: "Team Meat",
options: ["Team Meat", "Edmund McMillen", "Subset Games", "MegaCrit"]
}, {
game: "Hotline Miami",
studio: "Dennaton Games",
options: ["Dennaton Games", "Team Meat", "Edmund McMillen", "Subset Games"]
}, {
game: "Papers, Please",
studio: "Lucas Pope",
options: ["Lucas Pope", "Dennaton Games", "Team Meat", "Edmund McMillen"]
}, {
game: "Return of the Obra Dinn",
studio: "Lucas Pope",
options: ["Lucas Pope", "Dennaton Games", "Team Meat", "Edmund McMillen"]
}, {
game: "Oxenfree",
studio: "Night School Studio",
options: ["Night School Studio", "Lucas Pope", "Dennaton Games", "Team Meat"]
}, {
game: "Firewatch",
studio: "Campo Santo",
options: ["Campo Santo", "Night School Studio", "Lucas Pope", "Dennaton Games"]
}, {
game: "Gone Home",
studio: "The Fullbright Company",
options: ["The Fullbright Company", "Campo Santo", "Night School Studio", "Lucas Pope"]
}, {
game: "What Remains of Edith Finch",
studio: "Giant Sparrow",
options: ["Giant Sparrow", "The Fullbright Company", "Campo Santo", "Night School Studio"]
}, {
game: "Outer Wilds",
studio: "Mobius Digital",
options: ["Mobius Digital", "Giant Sparrow", "The Fullbright Company", "Campo Santo"]
}, {
game: "Journey to the Savage Planet",
studio: "Typhoon Studios",
options: ["Typhoon Studios", "Mobius Digital", "Giant Sparrow", "The Fullbright Company"]
}, {
game: "Control",
studio: "Remedy",
options: ["Remedy", "Typhoon Studios", "Mobius Digital", "Giant Sparrow"]
}, {
game: "Quantum Break",
studio: "Remedy",
options: ["Remedy", "Typhoon Studios", "Mobius Digital", "Giant Sparrow"]
}, {
game: "Detroit: Become Human",
studio: "Quantic Dream",
options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
}, {
game: "Heavy Rain",
studio: "Quantic Dream",
options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
}, {
game: "Beyond: Two Souls",
studio: "Quantic Dream",
options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
}, {
game: "Until Dawn",
studio: "Supermassive Games",
options: ["Supermassive Games", "Quantic Dream", "Remedy", "Typhoon Studios"]
}, {
game: "Little Nightmares",
studio: "Tarsier Studios",
options: ["Tarsier Studios", "Supermassive Games", "Quantic Dream", "Remedy"]
}, {
game: "Inside",
studio: "Playdead",
options: ["Playdead", "Tarsier Studios", "Supermassive Games", "Quantic Dream"]
}, {
game: "Limbo",
studio: "Playdead",
options: ["Playdead", "Tarsier Studios", "Supermassive Games", "Quantic Dream"]
}, {
game: "Journey",
studio: "thatgamecompany",
options: ["thatgamecompany", "Playdead", "Tarsier Studios", "Supermassive Games"]
}, {
game: "Abzû",
studio: "Giant Squid",
options: ["Giant Squid", "thatgamecompany", "Playdead", "Tarsier Studios"]
}, {
game: "The Pathless",
studio: "Giant Squid",
options: ["Giant Squid", "thatgamecompany", "Playdead", "Tarsier Studios"]
}, {
game: "No Man's Sky",
studio: "Hello Games",
options: ["Hello Games", "Giant Squid", "thatgamecompany", "Playdead"]
}, {
game: "Journey to the Savage Planet",
studio: "Typhoon Studios",
options: ["Typhoon Studios", "Hello Games", "Giant Squid", "thatgamecompany"]
}];
// Shuffle quizData for each game session
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;
}
}
// --- Game State ---
var currentQuestion = 0;
var score = 0;
var timeLeft = 60; // seconds
var timerInterval = null;
var optionButtons = [];
var isAnswered = false;
// --- UI Elements ---
// Title
var titleTxt = new Text2("Game Studio Guessr", {
size: 110,
fill: 0xF7C873
});
titleTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(titleTxt);
// Score
var scoreTxt = new Text2("Score: 0", {
size: 70,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Timer
var timerTxt = new Text2("Time: 60", {
size: 70,
fill: 0xFFFFFF
});
timerTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(timerTxt);
// Question text
var questionTxt = new Text2("", {
size: 90,
fill: 0xFFFFFF
});
questionTxt.anchor.set(0.5, 0.5);
game.addChild(questionTxt);
// --- Layout positions ---
function layoutUI() {
// Title at top center, below safe area
titleTxt.x = LK.gui.width / 2;
titleTxt.y = 40;
// Score at top left (but not in the 0,0 area)
scoreTxt.x = LK.gui.width / 2 - 500;
scoreTxt.y = 40;
// Timer at top right
timerTxt.x = LK.gui.width / 2 + 500;
timerTxt.y = 40;
// Question in center
questionTxt.x = 2048 / 2;
questionTxt.y = 600;
// Option buttons: vertical stack, centered
var startY = 1100;
var spacing = 260;
for (var i = 0; i < optionButtons.length; i++) {
var btn = optionButtons[i];
btn.x = 2048 / 2;
btn.y = startY + i * spacing;
}
}
// --- Option Buttons ---
function createOptionButtons() {
// Remove old buttons
for (var i = 0; i < optionButtons.length; i++) {
optionButtons[i].destroy();
}
optionButtons = [];
// Create 4 buttons
for (var i = 0; i < 4; i++) {
var btn = new OptionButton();
btn.setText("");
btn.setEnabled(false);
game.addChild(btn);
optionButtons.push(btn);
}
layoutUI();
}
// --- Show Question ---
function showQuestion(idx) {
isAnswered = false;
if (idx >= quizData.length) {
endGame();
return;
}
var q = quizData[idx];
questionTxt.setText("Who made:\n" + q.game + "?");
// Shuffle options for this question
var options = q.options.slice();
shuffleArray(options);
// Set button text and callbacks
for (var i = 0; i < optionButtons.length; i++) {
var btn = optionButtons[i];
btn.setText(options[i]);
btn.setEnabled(true);
(function (btn, answer) {
btn.setCallback(function () {
if (isAnswered) return;
isAnswered = true;
handleAnswer(answer, q.studio, btn);
});
})(btn, options[i]);
}
layoutUI();
}
// --- Handle Answer ---
function handleAnswer(selected, correct, btn) {
// Disable all buttons
for (var i = 0; i < optionButtons.length; i++) {
optionButtons[i].setEnabled(false);
}
// Visual feedback
if (selected === correct) {
// Correct: flash green
tween(btn, {
tint: 0x4caf50
}, {
duration: 200,
onFinish: function onFinish() {
tween(btn, {
tint: 0x2d2d2d
}, {
duration: 300
});
}
});
score += 1;
scoreTxt.setText("Score: " + score);
} else {
// Incorrect: flash red
tween(btn, {
tint: 0xff3b30
}, {
duration: 200,
onFinish: function onFinish() {
tween(btn, {
tint: 0x2d2d2d
}, {
duration: 300
});
}
});
// Also flash correct button green
for (var i = 0; i < optionButtons.length; i++) {
if (optionButtons[i].text === correct) {
tween(optionButtons[i], {
tint: 0x4caf50
}, {
duration: 200,
onFinish: function onFinish() {
tween(optionButtons[i], {
tint: 0x2d2d2d
}, {
duration: 300
});
}
});
}
}
}
// Next question after short delay
LK.setTimeout(function () {
currentQuestion += 1;
showQuestion(currentQuestion);
}, 700);
}
// --- Timer ---
function startTimer() {
timeLeft = 60;
timerTxt.setText("Time: " + timeLeft);
if (timerInterval) LK.clearInterval(timerInterval);
timerInterval = LK.setInterval(function () {
timeLeft -= 1;
timerTxt.setText("Time: " + timeLeft);
if (timeLeft <= 0) {
LK.clearInterval(timerInterval);
endGame();
}
}, 1000);
}
// --- End Game ---
function endGame() {
// Show game over popup
LK.setScore(score);
LK.showGameOver();
}
// --- Game Start ---
function startGame() {
// Shuffle questions
shuffleArray(quizData);
currentQuestion = 0;
score = 0;
scoreTxt.setText("Score: 0");
startTimer();
createOptionButtons();
showQuestion(currentQuestion);
}
// --- Responsive Layout ---
game.on('resize', function () {
layoutUI();
});
// --- Start ---
startGame(); ===================================================================
--- original.js
+++ change.js
@@ -97,8 +97,460 @@
}, {
game: "Red Dead Redemption 2",
studio: "Rockstar Games",
options: ["Rockstar Games", "Ubisoft", "Valve", "Nintendo"]
+}, {
+ game: "Assassin's Creed II",
+ studio: "Ubisoft",
+ options: ["Ubisoft", "Rockstar Games", "Valve", "Nintendo"]
+}, {
+ game: "Half-Life 2",
+ studio: "Valve",
+ options: ["Valve", "Bethesda", "Ubisoft", "CD Projekt Red"]
+}, {
+ game: "The Last of Us",
+ studio: "Naughty Dog",
+ options: ["Naughty Dog", "Santa Monica Studio", "Rockstar Games", "Remedy"]
+}, {
+ game: "Bloodborne",
+ studio: "FromSoftware",
+ options: ["FromSoftware", "Capcom", "Square Enix", "Remedy"]
+}, {
+ game: "Mass Effect 2",
+ studio: "BioWare",
+ options: ["BioWare", "EA", "Ubisoft", "Bethesda"]
+}, {
+ game: "Elden Ring",
+ studio: "FromSoftware",
+ options: ["FromSoftware", "Capcom", "Square Enix", "Remedy"]
+}, {
+ game: "Cyberpunk 2077",
+ studio: "CD Projekt Red",
+ options: ["CD Projekt Red", "Bethesda", "Square Enix", "Capcom"]
+}, {
+ game: "The Elder Scrolls V: Skyrim",
+ studio: "Bethesda",
+ options: ["Bethesda", "CD Projekt Red", "Ubisoft", "Valve"]
+}, {
+ game: "DOOM (2016)",
+ studio: "id Software",
+ options: ["id Software", "Bethesda", "Valve", "Ubisoft"]
+}, {
+ game: "Minecraft",
+ studio: "Mojang",
+ options: ["Mojang", "Epic Games", "Valve", "Nintendo"]
+}, {
+ game: "Fortnite",
+ studio: "Epic Games",
+ options: ["Epic Games", "Riot Games", "Valve", "Ubisoft"]
+}, {
+ game: "League of Legends",
+ studio: "Riot Games",
+ options: ["Riot Games", "Epic Games", "Valve", "Ubisoft"]
+}, {
+ game: "Counter-Strike: Global Offensive",
+ studio: "Valve",
+ options: ["Valve", "Ubisoft", "EA", "Rockstar Games"]
+}, {
+ game: "Animal Crossing: New Horizons",
+ studio: "Nintendo",
+ options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
+}, {
+ game: "Persona 5",
+ studio: "Atlus",
+ options: ["Atlus", "Square Enix", "Capcom", "Bandai Namco"]
+}, {
+ game: "Final Fantasy VII",
+ studio: "Square Enix",
+ options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
+}, {
+ game: "Street Fighter II",
+ studio: "Capcom",
+ options: ["Capcom", "Bandai Namco", "Square Enix", "Nintendo"]
+}, {
+ game: "Tekken 3",
+ studio: "Bandai Namco",
+ options: ["Bandai Namco", "Capcom", "Square Enix", "Nintendo"]
+}, {
+ game: "Pac-Man",
+ studio: "Namco",
+ options: ["Namco", "Nintendo", "Atari", "Sega"]
+}, {
+ game: "Sonic the Hedgehog",
+ studio: "Sega",
+ options: ["Sega", "Nintendo", "Namco", "Capcom"]
+}, {
+ game: "Tetris",
+ studio: "Alexey Pajitnov",
+ options: ["Alexey Pajitnov", "Nintendo", "Sega", "Atari"]
+}, {
+ game: "Donkey Kong",
+ studio: "Nintendo",
+ options: ["Nintendo", "Sega", "Namco", "Capcom"]
+}, {
+ game: "Metroid Prime",
+ studio: "Retro Studios",
+ options: ["Retro Studios", "Nintendo", "Capcom", "Ubisoft"]
+}, {
+ game: "Splatoon",
+ studio: "Nintendo",
+ options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
+}, {
+ game: "Fire Emblem: Three Houses",
+ studio: "Intelligent Systems",
+ options: ["Intelligent Systems", "Nintendo", "Capcom", "Square Enix"]
+}, {
+ game: "Pokémon Red and Blue",
+ studio: "Game Freak",
+ options: ["Game Freak", "Nintendo", "Capcom", "Bandai Namco"]
+}, {
+ game: "Pokémon GO",
+ studio: "Niantic",
+ options: ["Niantic", "Nintendo", "Game Freak", "Bandai Namco"]
+}, {
+ game: "Super Smash Bros. Ultimate",
+ studio: "Nintendo",
+ options: ["Nintendo", "Bandai Namco", "Capcom", "Ubisoft"]
+}, {
+ game: "Mario Kart 8 Deluxe",
+ studio: "Nintendo",
+ options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
+}, {
+ game: "Super Mario Odyssey",
+ studio: "Nintendo",
+ options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
+}, {
+ game: "The Legend of Zelda: Ocarina of Time",
+ studio: "Nintendo",
+ options: ["Nintendo", "Ubisoft", "Valve", "Rockstar Games"]
+}, {
+ game: "The Sims",
+ studio: "Maxis",
+ options: ["Maxis", "EA", "Ubisoft", "Valve"]
+}, {
+ game: "SimCity",
+ studio: "Maxis",
+ options: ["Maxis", "EA", "Ubisoft", "Valve"]
+}, {
+ game: "Spore",
+ studio: "Maxis",
+ options: ["Maxis", "EA", "Ubisoft", "Valve"]
+}, {
+ game: "FIFA 21",
+ studio: "EA Sports",
+ options: ["EA Sports", "Konami", "Ubisoft", "Valve"]
+}, {
+ game: "Pro Evolution Soccer",
+ studio: "Konami",
+ options: ["Konami", "EA Sports", "Ubisoft", "Valve"]
+}, {
+ game: "Silent Hill 2",
+ studio: "Konami",
+ options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Metal Gear Solid",
+ studio: "Konami",
+ options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Castlevania: Symphony of the Night",
+ studio: "Konami",
+ options: ["Konami", "Capcom", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Resident Evil 2",
+ studio: "Capcom",
+ options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Monster Hunter: World",
+ studio: "Capcom",
+ options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Mega Man 2",
+ studio: "Capcom",
+ options: ["Capcom", "Konami", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Dragon Quest XI",
+ studio: "Square Enix",
+ options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
+}, {
+ game: "Kingdom Hearts",
+ studio: "Square Enix",
+ options: ["Square Enix", "Capcom", "Atlus", "Nintendo"]
+}, {
+ game: "Chrono Trigger",
+ studio: "Square",
+ options: ["Square", "Enix", "Capcom", "Nintendo"]
+}, {
+ game: "Persona 4 Golden",
+ studio: "Atlus",
+ options: ["Atlus", "Square Enix", "Capcom", "Bandai Namco"]
+}, {
+ game: "Yakuza 0",
+ studio: "Sega",
+ options: ["Sega", "Capcom", "Square Enix", "Bandai Namco"]
+}, {
+ game: "Bayonetta",
+ studio: "PlatinumGames",
+ options: ["PlatinumGames", "Sega", "Capcom", "Nintendo"]
+}, {
+ game: "NieR: Automata",
+ studio: "PlatinumGames",
+ options: ["PlatinumGames", "Square Enix", "Capcom", "Nintendo"]
+}, {
+ game: "Journey",
+ studio: "thatgamecompany",
+ options: ["thatgamecompany", "Santa Monica Studio", "Naughty Dog", "Remedy"]
+}, {
+ game: "Flower",
+ studio: "thatgamecompany",
+ options: ["thatgamecompany", "Santa Monica Studio", "Naughty Dog", "Remedy"]
+}, {
+ game: "Inside",
+ studio: "Playdead",
+ options: ["Playdead", "Remedy", "Naughty Dog", "Santa Monica Studio"]
+}, {
+ game: "Limbo",
+ studio: "Playdead",
+ options: ["Playdead", "Remedy", "Naughty Dog", "Santa Monica Studio"]
+}, {
+ game: "Control",
+ studio: "Remedy",
+ options: ["Remedy", "Playdead", "Naughty Dog", "Santa Monica Studio"]
+}, {
+ game: "Alan Wake",
+ studio: "Remedy",
+ options: ["Remedy", "Playdead", "Naughty Dog", "Santa Monica Studio"]
+}, {
+ game: "Max Payne",
+ studio: "Remedy",
+ options: ["Remedy", "Rockstar Games", "Naughty Dog", "Santa Monica Studio"]
+}, {
+ game: "Grand Theft Auto: San Andreas",
+ studio: "Rockstar North",
+ options: ["Rockstar North", "Ubisoft", "Valve", "Nintendo"]
+}, {
+ game: "Bully",
+ studio: "Rockstar Vancouver",
+ options: ["Rockstar Vancouver", "Rockstar North", "Ubisoft", "Valve"]
+}, {
+ game: "L.A. Noire",
+ studio: "Team Bondi",
+ options: ["Team Bondi", "Rockstar North", "Ubisoft", "Valve"]
+}, {
+ game: "Bioshock",
+ studio: "Irrational Games",
+ options: ["Irrational Games", "2K Games", "Ubisoft", "Valve"]
+}, {
+ game: "Bioshock Infinite",
+ studio: "Irrational Games",
+ options: ["Irrational Games", "2K Games", "Ubisoft", "Valve"]
+}, {
+ game: "Borderlands 2",
+ studio: "Gearbox Software",
+ options: ["Gearbox Software", "2K Games", "Ubisoft", "Valve"]
+}, {
+ game: "Civilization VI",
+ studio: "Firaxis Games",
+ options: ["Firaxis Games", "2K Games", "Ubisoft", "Valve"]
+}, {
+ game: "XCOM 2",
+ studio: "Firaxis Games",
+ options: ["Firaxis Games", "2K Games", "Ubisoft", "Valve"]
+}, {
+ game: "Sid Meier's Pirates!",
+ studio: "MicroProse",
+ options: ["MicroProse", "Firaxis Games", "2K Games", "Ubisoft"]
+}, {
+ game: "The Outer Worlds",
+ studio: "Obsidian Entertainment",
+ options: ["Obsidian Entertainment", "Bethesda", "CD Projekt Red", "BioWare"]
+}, {
+ game: "Fallout: New Vegas",
+ studio: "Obsidian Entertainment",
+ options: ["Obsidian Entertainment", "Bethesda", "CD Projekt Red", "BioWare"]
+}, {
+ game: "Fallout 3",
+ studio: "Bethesda",
+ options: ["Bethesda", "Obsidian Entertainment", "CD Projekt Red", "BioWare"]
+}, {
+ game: "Dishonored",
+ studio: "Arkane Studios",
+ options: ["Arkane Studios", "Bethesda", "Obsidian Entertainment", "BioWare"]
+}, {
+ game: "Prey (2017)",
+ studio: "Arkane Studios",
+ options: ["Arkane Studios", "Bethesda", "Obsidian Entertainment", "BioWare"]
+}, {
+ game: "Wolfenstein: The New Order",
+ studio: "MachineGames",
+ options: ["MachineGames", "id Software", "Bethesda", "Obsidian Entertainment"]
+}, {
+ game: "Quake",
+ studio: "id Software",
+ options: ["id Software", "Bethesda", "Obsidian Entertainment", "MachineGames"]
+}, {
+ game: "Doom Eternal",
+ studio: "id Software",
+ options: ["id Software", "Bethesda", "Obsidian Entertainment", "MachineGames"]
+}, {
+ game: "Cuphead",
+ studio: "Studio MDHR",
+ options: ["Studio MDHR", "Team Cherry", "Playdead", "Remedy"]
+}, {
+ game: "Hollow Knight",
+ studio: "Team Cherry",
+ options: ["Team Cherry", "Studio MDHR", "Playdead", "Remedy"]
+}, {
+ game: "Celeste",
+ studio: "Matt Makes Games",
+ options: ["Matt Makes Games", "Team Cherry", "Studio MDHR", "Playdead"]
+}, {
+ game: "Undertale",
+ studio: "Toby Fox",
+ options: ["Toby Fox", "Matt Makes Games", "Team Cherry", "Studio MDHR"]
+}, {
+ game: "Stardew Valley",
+ studio: "ConcernedApe",
+ options: ["ConcernedApe", "Toby Fox", "Matt Makes Games", "Team Cherry"]
+}, {
+ game: "Terraria",
+ studio: "Re-Logic",
+ options: ["Re-Logic", "ConcernedApe", "Toby Fox", "Matt Makes Games"]
+}, {
+ game: "Ori and the Blind Forest",
+ studio: "Moon Studios",
+ options: ["Moon Studios", "Re-Logic", "ConcernedApe", "Toby Fox"]
+}, {
+ game: "Ori and the Will of the Wisps",
+ studio: "Moon Studios",
+ options: ["Moon Studios", "Re-Logic", "ConcernedApe", "Toby Fox"]
+}, {
+ game: "Hades",
+ studio: "Supergiant Games",
+ options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
+}, {
+ game: "Transistor",
+ studio: "Supergiant Games",
+ options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
+}, {
+ game: "Bastion",
+ studio: "Supergiant Games",
+ options: ["Supergiant Games", "Moon Studios", "Re-Logic", "ConcernedApe"]
+}, {
+ game: "Dead Cells",
+ studio: "Motion Twin",
+ options: ["Motion Twin", "Supergiant Games", "Moon Studios", "Re-Logic"]
+}, {
+ game: "Slay the Spire",
+ studio: "MegaCrit",
+ options: ["MegaCrit", "Motion Twin", "Supergiant Games", "Moon Studios"]
+}, {
+ game: "Into the Breach",
+ studio: "Subset Games",
+ options: ["Subset Games", "MegaCrit", "Motion Twin", "Supergiant Games"]
+}, {
+ game: "FTL: Faster Than Light",
+ studio: "Subset Games",
+ options: ["Subset Games", "MegaCrit", "Motion Twin", "Supergiant Games"]
+}, {
+ game: "The Binding of Isaac",
+ studio: "Edmund McMillen",
+ options: ["Edmund McMillen", "Subset Games", "MegaCrit", "Motion Twin"]
+}, {
+ game: "Super Meat Boy",
+ studio: "Team Meat",
+ options: ["Team Meat", "Edmund McMillen", "Subset Games", "MegaCrit"]
+}, {
+ game: "Hotline Miami",
+ studio: "Dennaton Games",
+ options: ["Dennaton Games", "Team Meat", "Edmund McMillen", "Subset Games"]
+}, {
+ game: "Papers, Please",
+ studio: "Lucas Pope",
+ options: ["Lucas Pope", "Dennaton Games", "Team Meat", "Edmund McMillen"]
+}, {
+ game: "Return of the Obra Dinn",
+ studio: "Lucas Pope",
+ options: ["Lucas Pope", "Dennaton Games", "Team Meat", "Edmund McMillen"]
+}, {
+ game: "Oxenfree",
+ studio: "Night School Studio",
+ options: ["Night School Studio", "Lucas Pope", "Dennaton Games", "Team Meat"]
+}, {
+ game: "Firewatch",
+ studio: "Campo Santo",
+ options: ["Campo Santo", "Night School Studio", "Lucas Pope", "Dennaton Games"]
+}, {
+ game: "Gone Home",
+ studio: "The Fullbright Company",
+ options: ["The Fullbright Company", "Campo Santo", "Night School Studio", "Lucas Pope"]
+}, {
+ game: "What Remains of Edith Finch",
+ studio: "Giant Sparrow",
+ options: ["Giant Sparrow", "The Fullbright Company", "Campo Santo", "Night School Studio"]
+}, {
+ game: "Outer Wilds",
+ studio: "Mobius Digital",
+ options: ["Mobius Digital", "Giant Sparrow", "The Fullbright Company", "Campo Santo"]
+}, {
+ game: "Journey to the Savage Planet",
+ studio: "Typhoon Studios",
+ options: ["Typhoon Studios", "Mobius Digital", "Giant Sparrow", "The Fullbright Company"]
+}, {
+ game: "Control",
+ studio: "Remedy",
+ options: ["Remedy", "Typhoon Studios", "Mobius Digital", "Giant Sparrow"]
+}, {
+ game: "Quantum Break",
+ studio: "Remedy",
+ options: ["Remedy", "Typhoon Studios", "Mobius Digital", "Giant Sparrow"]
+}, {
+ game: "Detroit: Become Human",
+ studio: "Quantic Dream",
+ options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
+}, {
+ game: "Heavy Rain",
+ studio: "Quantic Dream",
+ options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
+}, {
+ game: "Beyond: Two Souls",
+ studio: "Quantic Dream",
+ options: ["Quantic Dream", "Remedy", "Typhoon Studios", "Mobius Digital"]
+}, {
+ game: "Until Dawn",
+ studio: "Supermassive Games",
+ options: ["Supermassive Games", "Quantic Dream", "Remedy", "Typhoon Studios"]
+}, {
+ game: "Little Nightmares",
+ studio: "Tarsier Studios",
+ options: ["Tarsier Studios", "Supermassive Games", "Quantic Dream", "Remedy"]
+}, {
+ game: "Inside",
+ studio: "Playdead",
+ options: ["Playdead", "Tarsier Studios", "Supermassive Games", "Quantic Dream"]
+}, {
+ game: "Limbo",
+ studio: "Playdead",
+ options: ["Playdead", "Tarsier Studios", "Supermassive Games", "Quantic Dream"]
+}, {
+ game: "Journey",
+ studio: "thatgamecompany",
+ options: ["thatgamecompany", "Playdead", "Tarsier Studios", "Supermassive Games"]
+}, {
+ game: "Abzû",
+ studio: "Giant Squid",
+ options: ["Giant Squid", "thatgamecompany", "Playdead", "Tarsier Studios"]
+}, {
+ game: "The Pathless",
+ studio: "Giant Squid",
+ options: ["Giant Squid", "thatgamecompany", "Playdead", "Tarsier Studios"]
+}, {
+ game: "No Man's Sky",
+ studio: "Hello Games",
+ options: ["Hello Games", "Giant Squid", "thatgamecompany", "Playdead"]
+}, {
+ game: "Journey to the Savage Planet",
+ studio: "Typhoon Studios",
+ options: ["Typhoon Studios", "Hello Games", "Giant Squid", "thatgamecompany"]
}];
// Shuffle quizData for each game session
function shuffleArray(arr) {
for (var i = arr.length - 1; i > 0; i--) {