User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'split')' in or related to this line: 'phaseText.setText(phaseText.text.split('(')[0] + '(' + secondsLeft + 's)');' Line Number: 3141
User prompt
el impostor pot sabotear electricitat,oxigen,portes de la nau,reactor i conexions que fa que te oculti la barra de task i apaga las cameras
User prompt
fes les portes que el impostor pot tancar
User prompt
fes un boto per obrir las camaras
User prompt
fes las camaras i la sala de camaras
User prompt
fes la task de els cables
User prompt
fes un boto per fer las tasks
User prompt
fes els pasadisos de la nau del among us
User prompt
fes que el spawn no pugui apareixer en un mur
User prompt
fes las tasks de among us
User prompt
crea un boto per reportar
User prompt
fes que es pugui skip la votacio de emergencia
User prompt
crea el boto de sabotages per el impostor
User prompt
fes que el impostor mati a tripulants si nosaltres no ho som
User prompt
Please fix the bug: 'TypeError: taskGraphics.removeFromParent is not a function' in or related to this line: 'taskGraphics.removeFromParent();' Line Number: 182
User prompt
fes que els tripulants facin les tasques
User prompt
fes que els murs no es puguin atravesar
User prompt
Please fix the bug: 'TypeError: tween.to is not a function' in or related to this line: 'tween.to(killButton, {' Line Number: 814 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
fes que el impostor pugui matar a els tripulants
User prompt
fes que la camara segueixi al jugador
User prompt
fes la nau de el among us
User prompt
pots triar en ser el impostor o un tripulant
User prompt
fes varias tasques per las misions
User prompt
posa una barra de progres de las tasques
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 Player = Container.expand(function (isImpostor, color, id) { var self = Container.call(this); self.isImpostor = isImpostor || false; self.playerColor = color || 0x00ff00; self.playerId = id || 0; self.isAlive = true; self.speed = 3; self.targetX = 0; self.targetY = 0; self.tasksCompleted = 0; self.maxTasks = 5; self.canVote = true; self.lastKillTime = 0; self.killCooldown = 30000; // 30 seconds var playerGraphics = self.attachAsset(self.isImpostor ? 'impostor' : 'crewmate', { anchorX: 0.5, anchorY: 0.5 }); if (!self.isImpostor) { playerGraphics.tint = self.playerColor; } self.moveTo = function (x, y) { self.targetX = x; self.targetY = y; }; self.eliminate = function () { if (self.isAlive) { self.isAlive = false; self.alpha = 0.3; LK.getSound('eliminate').play(); } }; self.completeTask = function () { if (!self.isImpostor && self.isAlive) { self.tasksCompleted++; LK.getSound('taskComplete').play(); return true; } return false; }; self.canKill = function () { return self.isImpostor && self.isAlive && LK.ticks - self.lastKillTime > self.killCooldown; }; self.kill = function (target) { if (self.canKill() && target.isAlive && !target.isImpostor) { target.eliminate(); self.lastKillTime = LK.ticks; return true; } return false; }; self.update = function () { if (!self.isAlive) return; // Move towards target var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 5) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } }; return self; }); var Task = Container.expand(function (x, y, id, taskType) { var self = Container.call(this); self.taskId = id || 0; self.isCompleted = false; self.x = x; self.y = y; self.taskType = taskType || 'basic'; self.completionProgress = 0; self.requiredClicks = 1; self.completionTime = 0; self.isBeingCompleted = false; // Set task properties based on type switch (self.taskType) { case 'electrical': self.requiredClicks = 3; self.assetName = 'electricalTask'; self.taskName = 'Fix Wiring'; break; case 'engine': self.requiredClicks = 5; self.assetName = 'engineTask'; self.taskName = 'Fuel Engines'; break; case 'reactor': self.requiredClicks = 7; self.assetName = 'reactorTask'; self.taskName = 'Stabilize Reactor'; break; case 'navigation': self.requiredClicks = 4; self.assetName = 'navigationTask'; self.taskName = 'Chart Course'; break; case 'medical': self.requiredClicks = 6; self.assetName = 'medicalTask'; self.taskName = 'Submit Scan'; break; default: self.requiredClicks = 1; self.assetName = 'task'; self.taskName = 'Basic Task'; break; } var taskGraphics = self.attachAsset(self.assetName, { anchorX: 0.5, anchorY: 0.5 }); // Add task name text var taskNameText = new Text2(self.taskName, { size: 24, fill: 0xFFFFFF }); taskNameText.anchor.set(0.5, 0); taskNameText.y = -50; self.addChild(taskNameText); self.complete = function () { if (!self.isCompleted) { self.isCompleted = true; taskGraphics.removeFromParent(); taskNameText.removeFromParent(); var completedGraphics = self.attachAsset('taskCompleted', { anchorX: 0.5, anchorY: 0.5 }); var completedText = new Text2('Complete', { size: 20, fill: 0x00FF00 }); completedText.anchor.set(0.5, 0); completedText.y = -40; self.addChild(completedText); return true; } return false; }; self.down = function (x, y, obj) { if (currentPlayer && currentPlayer.isAlive && !currentPlayer.isImpostor) { var distance = Math.sqrt(Math.pow(currentPlayer.x - self.x, 2) + Math.pow(currentPlayer.y - self.y, 2)); if (distance < 100 && !self.isCompleted) { self.completionProgress++; // Visual feedback for multi-click tasks if (self.requiredClicks > 1) { var progressText = new Text2(self.completionProgress + '/' + self.requiredClicks, { size: 32, fill: 0xFFFF00 }); progressText.anchor.set(0.5, 0); progressText.y = 50; self.addChild(progressText); // Remove old progress text if (self.lastProgressText) { self.lastProgressText.removeFromParent(); } self.lastProgressText = progressText; // Flash effect for progress tween.to(taskGraphics, { alpha: 0.5 }, 100).then(function () { tween.to(taskGraphics, { alpha: 1.0 }, 100); }); } if (self.completionProgress >= self.requiredClicks) { self.complete(); currentPlayer.completeTask(); completedTasks++; updateTaskProgress(); } } } }; return self; }); var VoteButton = Container.expand(function (playerId, x, y) { var self = Container.call(this); self.playerId = playerId; self.x = x; self.y = y; self.votes = 0; var buttonGraphics = self.attachAsset('voteButton', { anchorX: 0.5, anchorY: 0.5 }); var voteText = new Text2('Vote Player ' + playerId, { size: 40, fill: 0xFFFFFF }); voteText.anchor.set(0.5, 0.5); self.addChild(voteText); self.down = function (x, y, obj) { if (votingPhase && currentPlayer && currentPlayer.canVote) { self.votes++; currentPlayer.canVote = false; LK.getSound('vote').play(); voteText.setText('Votes: ' + self.votes); // Check if voting is complete var alivePlayers = players.filter(function (p) { return p.isAlive; }); var totalVotes = voteButtons.reduce(function (sum, button) { return sum + button.votes; }, 0); if (totalVotes >= alivePlayers.length) { endVoting(); } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ var players = []; var tasks = []; var currentPlayer = null; var totalTasks = 15; var completedTasks = 0; var impostorCount = 2; var votingPhase = false; var voteButtons = []; var gamePhase = 'roleSelection'; // 'roleSelection', 'playing', 'voting', 'gameOver' var meetingCooldown = 0; var meetingCooldownTime = 15000; // 15 seconds var roleSelectionComplete = false; // UI Elements var taskProgressText = new Text2('Tasks: 0/' + totalTasks, { size: 60, fill: 0xFFFFFF }); taskProgressText.anchor.set(0.5, 0); LK.gui.top.addChild(taskProgressText); // Progress Bar Elements var progressBarBackground = LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 0.5, x: 0, y: 80 }); progressBarBackground.tint = 0x333333; LK.gui.top.addChild(progressBarBackground); var progressBarFill = LK.getAsset('wall', { anchorX: 0, anchorY: 0.5, scaleX: 0, scaleY: 0.4, x: -800, y: 80 }); progressBarFill.tint = 0x00ff00; LK.gui.top.addChild(progressBarFill); var phaseText = new Text2('Complete Tasks or Find Impostors!', { size: 50, fill: 0xFFFF00 }); phaseText.anchor.set(0.5, 0); phaseText.y = 100; LK.gui.top.addChild(phaseText); var playerCountText = new Text2('', { size: 40, fill: 0xFFFFFF }); playerCountText.anchor.set(0, 0); LK.gui.topRight.addChild(playerCountText); // Role selection UI var roleSelectionTitle = new Text2('Choose Your Role', { size: 80, fill: 0xFFFFFF }); roleSelectionTitle.anchor.set(0.5, 0.5); roleSelectionTitle.x = 1024; roleSelectionTitle.y = 800; game.addChild(roleSelectionTitle); var crewButton = LK.getAsset('voteButton', { anchorX: 0.5, anchorY: 0.5, x: 700, y: 1200, scaleX: 1.5, scaleY: 1.5 }); crewButton.tint = 0x00ff00; game.addChild(crewButton); var crewButtonText = new Text2('CREW MEMBER', { size: 50, fill: 0xFFFFFF }); crewButtonText.anchor.set(0.5, 0.5); crewButtonText.x = 700; crewButtonText.y = 1200; game.addChild(crewButtonText); var impostorButton = LK.getAsset('voteButton', { anchorX: 0.5, anchorY: 0.5, x: 1348, y: 1200, scaleX: 1.5, scaleY: 1.5 }); impostorButton.tint = 0xff0000; game.addChild(impostorButton); var impostorButtonText = new Text2('IMPOSTOR', { size: 50, fill: 0xFFFFFF }); impostorButtonText.anchor.set(0.5, 0.5); impostorButtonText.x = 1348; impostorButtonText.y = 1200; game.addChild(impostorButtonText); // Role selection instructions var instructionText = new Text2('Choose your role and start the game!', { size: 40, fill: 0xFFFF00 }); instructionText.anchor.set(0.5, 0.5); instructionText.x = 1024; instructionText.y = 1400; game.addChild(instructionText); // Create spaceship walls var walls = []; function createWalls() { // Top wall var topWall = game.addChild(LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, scaleX: 10, x: 1024, y: 200 })); walls.push(topWall); // Bottom wall var bottomWall = game.addChild(LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, scaleX: 10, x: 1024, y: 2500 })); walls.push(bottomWall); // Left wall var leftWall = game.addChild(LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, scaleY: 10, x: 200, y: 1366 })); walls.push(leftWall); // Right wall var rightWall = game.addChild(LK.getAsset('wall', { anchorX: 0.5, anchorY: 0.5, scaleY: 10, x: 1800, y: 1366 })); walls.push(rightWall); } // Create emergency button var emergencyButton = game.addChild(LK.getAsset('emergencyButton', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366 })); emergencyButton.down = function (x, y, obj) { if (gamePhase === 'playing' && meetingCooldown <= 0) { startEmergencyMeeting(); } }; // Role selection button handlers crewButton.down = function (x, y, obj) { if (gamePhase === 'roleSelection') { selectRole(false); // false = crew member } }; impostorButton.down = function (x, y, obj) { if (gamePhase === 'roleSelection') { selectRole(true); // true = impostor } }; // Initialize players function selectRole(isImpostor) { // Hide role selection UI roleSelectionTitle.destroy(); crewButton.destroy(); crewButtonText.destroy(); impostorButton.destroy(); impostorButtonText.destroy(); instructionText.destroy(); // Initialize game with selected role initializePlayers(isImpostor); updatePlayerCount(); gamePhase = 'playing'; phaseText.setText('Complete Tasks or Find Impostors!'); } function initializePlayers(playerIsImpostor) { var colors = [0x00ff00, 0x0000ff, 0xff00ff, 0x00ffff, 0xffa500, 0xffff00, 0x8a2be2, 0xffc0cb]; // Create current player first with selected role currentPlayer = new Player(playerIsImpostor, colors[0], 0); currentPlayer.x = 400 + Math.random() * 1200; currentPlayer.y = 400 + Math.random() * 1800; currentPlayer.targetX = currentPlayer.x; currentPlayer.targetY = currentPlayer.y; players.push(currentPlayer); game.addChild(currentPlayer); // Create other players var remainingImpostors = playerIsImpostor ? impostorCount - 1 : impostorCount; for (var i = 1; i < 8; i++) { var isImpostor = i <= remainingImpostors; var player = new Player(isImpostor, colors[i], i); // Random spawn position player.x = 400 + Math.random() * 1200; player.y = 400 + Math.random() * 1800; player.targetX = player.x; player.targetY = player.y; players.push(player); game.addChild(player); } } // Initialize tasks function initializeTasks() { var taskTypes = ['basic', 'electrical', 'engine', 'reactor', 'navigation', 'medical']; var taskAreas = [{ x: 400, y: 500, width: 300, height: 200 }, // Upper left area { x: 1200, y: 500, width: 300, height: 200 }, // Upper right area { x: 400, y: 1200, width: 300, height: 200 }, // Center left area { x: 1200, y: 1200, width: 300, height: 200 }, // Center right area { x: 400, y: 2000, width: 300, height: 200 }, // Lower left area { x: 1200, y: 2000, width: 300, height: 200 }, // Lower right area { x: 800, y: 800, width: 400, height: 300 }, // Central area { x: 800, y: 1600, width: 400, height: 300 } // Lower central area ]; for (var i = 0; i < totalTasks; i++) { // Distribute tasks across different areas var area = taskAreas[i % taskAreas.length]; var taskX = area.x + Math.random() * area.width; var taskY = area.y + Math.random() * area.height; // Assign task type based on distribution var taskType = taskTypes[Math.floor(Math.random() * taskTypes.length)]; // Ensure variety - don't have too many of the same type consecutively if (i > 0 && tasks[i - 1].taskType === taskType && Math.random() < 0.5) { taskType = taskTypes[Math.floor(Math.random() * taskTypes.length)]; } var task = new Task(taskX, taskY, i, taskType); tasks.push(task); game.addChild(task); } } function updateTaskProgress() { taskProgressText.setText('Tasks: ' + completedTasks + '/' + totalTasks); // Update progress bar var progressPercentage = completedTasks / totalTasks; progressBarFill.scaleX = progressPercentage * 8; // Check win condition if (completedTasks >= totalTasks) { endGame('crew'); } } function updatePlayerCount() { var aliveCrew = players.filter(function (p) { return p.isAlive && !p.isImpostor; }).length; var aliveImpostors = players.filter(function (p) { return p.isAlive && p.isImpostor; }).length; playerCountText.setText('Crew: ' + aliveCrew + ' | Impostors: ' + aliveImpostors); // Check win conditions if (aliveImpostors >= aliveCrew) { endGame('impostors'); } else if (aliveImpostors === 0) { endGame('crew'); } } function startEmergencyMeeting() { gamePhase = 'voting'; votingPhase = true; meetingCooldown = meetingCooldownTime; LK.getSound('emergency').play(); phaseText.setText('Emergency Meeting - Vote!'); // Create vote buttons var alivePlayers = players.filter(function (p) { return p.isAlive; }); var buttonWidth = 200; var startX = (2048 - alivePlayers.length * buttonWidth) / 2; for (var i = 0; i < alivePlayers.length; i++) { var button = new VoteButton(alivePlayers[i].playerId, startX + i * buttonWidth, 2400); voteButtons.push(button); game.addChild(button); } // Reset player voting ability players.forEach(function (p) { if (p.isAlive) { p.canVote = true; } }); } function endVoting() { votingPhase = false; // Find player with most votes var maxVotes = 0; var ejectedPlayer = null; for (var i = 0; i < voteButtons.length; i++) { if (voteButtons[i].votes > maxVotes) { maxVotes = voteButtons[i].votes; ejectedPlayer = players.find(function (p) { return p.playerId === voteButtons[i].playerId; }); } } // Eject player with most votes if (ejectedPlayer && maxVotes > 0) { ejectedPlayer.eliminate(); if (ejectedPlayer.isImpostor) { phaseText.setText('Impostor Ejected!'); } else { phaseText.setText('Innocent Ejected!'); } } else { phaseText.setText('No One Ejected!'); } // Clean up vote buttons voteButtons.forEach(function (button) { button.destroy(); }); voteButtons = []; // Return to playing phase after delay LK.setTimeout(function () { gamePhase = 'playing'; phaseText.setText('Complete Tasks or Find Impostors!'); updatePlayerCount(); }, 3000); } function endGame(winner) { gamePhase = 'gameOver'; if (winner === 'crew') { phaseText.setText('Crew Wins!'); LK.showYouWin(); } else { phaseText.setText('Impostors Win!'); LK.showGameOver(); } } // AI behavior for other players function updateAI() { players.forEach(function (player) { if (player === currentPlayer || !player.isAlive) return; // Random movement if (Math.random() < 0.02) { player.moveTo(400 + Math.random() * 1200, 400 + Math.random() * 1800); } // Impostor AI if (player.isImpostor && gamePhase === 'playing') { // Try to kill nearby crew members var nearbyTargets = players.filter(function (p) { if (p === player || !p.isAlive || p.isImpostor) return false; var distance = Math.sqrt(Math.pow(p.x - player.x, 2) + Math.pow(p.y - player.y, 2)); return distance < 120; }); if (nearbyTargets.length > 0 && player.canKill()) { player.kill(nearbyTargets[0]); updatePlayerCount(); } } }); } // Initialize game createWalls(); initializeTasks(); // Don't initialize players yet - wait for role selection // Game controls game.down = function (x, y, obj) { if (gamePhase === 'playing' && currentPlayer && currentPlayer.isAlive) { currentPlayer.moveTo(x, y); } }; game.update = function () { if (gamePhase === 'roleSelection') { // Don't update game logic during role selection return; } // Update cooldowns if (meetingCooldown > 0) { meetingCooldown -= 16.67; // Roughly 1 frame at 60fps } // Update AI if (LK.ticks % 60 === 0) { // Update AI once per second updateAI(); } // Update current player AI behavior if impostor if (currentPlayer && currentPlayer.isImpostor && gamePhase === 'playing') { var nearbyTargets = players.filter(function (p) { if (p === currentPlayer || !p.isAlive || p.isImpostor) return false; var distance = Math.sqrt(Math.pow(p.x - currentPlayer.x, 2) + Math.pow(p.y - currentPlayer.y, 2)); return distance < 120; }); // Auto-kill if double-tap/hold near target if (nearbyTargets.length > 0 && currentPlayer.canKill()) { // Add visual indicator for kill opportunity if (LK.ticks % 30 < 15) { nearbyTargets[0].alpha = 0.7; } else { nearbyTargets[0].alpha = 1.0; } } } };
===================================================================
--- original.js
+++ change.js
@@ -240,11 +240,12 @@
var completedTasks = 0;
var impostorCount = 2;
var votingPhase = false;
var voteButtons = [];
-var gamePhase = 'playing'; // 'playing', 'voting', 'gameOver'
+var gamePhase = 'roleSelection'; // 'roleSelection', 'playing', 'voting', 'gameOver'
var meetingCooldown = 0;
var meetingCooldownTime = 15000; // 15 seconds
+var roleSelectionComplete = false;
// UI Elements
var taskProgressText = new Text2('Tasks: 0/' + totalTasks, {
size: 60,
fill: 0xFFFFFF
@@ -284,8 +285,62 @@
fill: 0xFFFFFF
});
playerCountText.anchor.set(0, 0);
LK.gui.topRight.addChild(playerCountText);
+// Role selection UI
+var roleSelectionTitle = new Text2('Choose Your Role', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+roleSelectionTitle.anchor.set(0.5, 0.5);
+roleSelectionTitle.x = 1024;
+roleSelectionTitle.y = 800;
+game.addChild(roleSelectionTitle);
+var crewButton = LK.getAsset('voteButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 700,
+ y: 1200,
+ scaleX: 1.5,
+ scaleY: 1.5
+});
+crewButton.tint = 0x00ff00;
+game.addChild(crewButton);
+var crewButtonText = new Text2('CREW MEMBER', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+crewButtonText.anchor.set(0.5, 0.5);
+crewButtonText.x = 700;
+crewButtonText.y = 1200;
+game.addChild(crewButtonText);
+var impostorButton = LK.getAsset('voteButton', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1348,
+ y: 1200,
+ scaleX: 1.5,
+ scaleY: 1.5
+});
+impostorButton.tint = 0xff0000;
+game.addChild(impostorButton);
+var impostorButtonText = new Text2('IMPOSTOR', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+impostorButtonText.anchor.set(0.5, 0.5);
+impostorButtonText.x = 1348;
+impostorButtonText.y = 1200;
+game.addChild(impostorButtonText);
+// Role selection instructions
+var instructionText = new Text2('Choose your role and start the game!', {
+ size: 40,
+ fill: 0xFFFF00
+});
+instructionText.anchor.set(0.5, 0.5);
+instructionText.x = 1024;
+instructionText.y = 1400;
+game.addChild(instructionText);
// Create spaceship walls
var walls = [];
function createWalls() {
// Top wall
@@ -336,13 +391,48 @@
if (gamePhase === 'playing' && meetingCooldown <= 0) {
startEmergencyMeeting();
}
};
+// Role selection button handlers
+crewButton.down = function (x, y, obj) {
+ if (gamePhase === 'roleSelection') {
+ selectRole(false); // false = crew member
+ }
+};
+impostorButton.down = function (x, y, obj) {
+ if (gamePhase === 'roleSelection') {
+ selectRole(true); // true = impostor
+ }
+};
// Initialize players
-function initializePlayers() {
+function selectRole(isImpostor) {
+ // Hide role selection UI
+ roleSelectionTitle.destroy();
+ crewButton.destroy();
+ crewButtonText.destroy();
+ impostorButton.destroy();
+ impostorButtonText.destroy();
+ instructionText.destroy();
+ // Initialize game with selected role
+ initializePlayers(isImpostor);
+ updatePlayerCount();
+ gamePhase = 'playing';
+ phaseText.setText('Complete Tasks or Find Impostors!');
+}
+function initializePlayers(playerIsImpostor) {
var colors = [0x00ff00, 0x0000ff, 0xff00ff, 0x00ffff, 0xffa500, 0xffff00, 0x8a2be2, 0xffc0cb];
- for (var i = 0; i < 8; i++) {
- var isImpostor = i < impostorCount;
+ // Create current player first with selected role
+ currentPlayer = new Player(playerIsImpostor, colors[0], 0);
+ currentPlayer.x = 400 + Math.random() * 1200;
+ currentPlayer.y = 400 + Math.random() * 1800;
+ currentPlayer.targetX = currentPlayer.x;
+ currentPlayer.targetY = currentPlayer.y;
+ players.push(currentPlayer);
+ game.addChild(currentPlayer);
+ // Create other players
+ var remainingImpostors = playerIsImpostor ? impostorCount - 1 : impostorCount;
+ for (var i = 1; i < 8; i++) {
+ var isImpostor = i <= remainingImpostors;
var player = new Player(isImpostor, colors[i], i);
// Random spawn position
player.x = 400 + Math.random() * 1200;
player.y = 400 + Math.random() * 1800;
@@ -350,12 +440,8 @@
player.targetY = player.y;
players.push(player);
game.addChild(player);
}
- // Set current player as first crew member
- currentPlayer = players.find(function (p) {
- return !p.isImpostor;
- });
}
// Initialize tasks
function initializeTasks() {
var taskTypes = ['basic', 'electrical', 'engine', 'reactor', 'navigation', 'medical'];
@@ -550,18 +636,21 @@
});
}
// Initialize game
createWalls();
-initializePlayers();
initializeTasks();
-updatePlayerCount();
+// Don't initialize players yet - wait for role selection
// Game controls
game.down = function (x, y, obj) {
- if (currentPlayer && currentPlayer.isAlive && gamePhase === 'playing') {
+ if (gamePhase === 'playing' && currentPlayer && currentPlayer.isAlive) {
currentPlayer.moveTo(x, y);
}
};
game.update = function () {
+ if (gamePhase === 'roleSelection') {
+ // Don't update game logic during role selection
+ return;
+ }
// Update cooldowns
if (meetingCooldown > 0) {
meetingCooldown -= 16.67; // Roughly 1 frame at 60fps
}
crewmate among us. In-Game asset. 2d. High contrast. No shadows
electricalTask. In-Game asset. 2d. High contrast. No shadows
emergencyButton. In-Game asset. 2d. High contrast. No shadows
voteButton among us. In-Game asset. 2d. High contrast. No shadows
killButton among us. In-Game asset. 2d. High contrast. No shadows
medicalTask. In-Game asset. 2d. High contrast. No shadows
engineTask among us. In-Game asset. 2d. High contrast. No shadows
navigationTask among us. In-Game asset. 2d. High contrast. No shadows
shipFloor casella. In-Game asset. 2d. High contrast. No shadows
shiphall among us. In-Game asset. 2d. High contrast. No shadows
among us task. In-Game asset. 2d. High contrast. No shadows
wall among us. In-Game asset. 2d. High contrast. No shadows
taskCompleted among us. In-Game asset. 2d. High contrast. No shadows
reactorTask among us. In-Game asset. 2d. High contrast. No shadows
taskButton among us. In-Game asset. 2d. High contrast. No shadows
sabotageButton among us. In-Game asset. 2d. High contrast. No shadows
reportbutton among us. In-Game asset. 2d. High contrast. No shadows
cameraView among us. In-Game asset. 2d. High contrast. No shadows
cameraFrame among us. In-Game asset. 2d. High contrast. No shadows
cameraButton among us. In-Game asset. 2d. High contrast. No shadows
cablePanel among us. In-Game asset. 2d. High contrast. No shadows
cableWire among us. In-Game asset. 2d. High contrast. No shadows
among us door. In-Game asset. 2d. High contrast. No shadows
among us doorButton. In-Game asset. 2d. High contrast. No shadows
among us doorClosed. In-Game asset. 2d. High contrast. No shadows
among us sabotageEffect. In-Game asset. 2d. High contrast. No shadows
among us sabotageIndicator. In-Game asset. 2d. High contrast. No shadows
among us cableConnector. In-Game asset. 2d. High contrast. No shadows
among us sabotageReactorButton. In-Game asset. 2d. High contrast. No shadows
among us sabotageOxygenButton. In-Game asset. 2d. High contrast. No shadows
among us sabotageElectricityButton. In-Game asset. 2d. High contrast. No shadows
among us sabotageDoorsButton. In-Game asset. 2d. High contrast. No shadows
among us sabotageConnectionsButton. In-Game asset. 2d. High contrast. No shadows
among us sewerEntrance. In-Game asset. 2d. High contrast. No shadows