/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var GridCell = Container.expand(function (gridX, gridY) { var self = Container.call(this); self.gridX = gridX; self.gridY = gridY; self.occupied = false; self.room = null; var cellGraphics = self.attachAsset('foundation', { anchorX: 0.5, anchorY: 0.5 }); cellGraphics.alpha = 0.3; self.highlight = function () { cellGraphics.alpha = 0.8; cellGraphics.tint = 0x00FF00; }; self.unhighlight = function () { cellGraphics.alpha = 0.3; cellGraphics.tint = 0xFFFFFF; }; self.setOccupied = function (room) { self.occupied = true; self.room = room; cellGraphics.alpha = 0.1; }; return self; }); var Room = Container.expand(function (roomType) { var self = Container.call(this); self.roomType = roomType; self.isPlaced = false; self.gridX = -1; self.gridY = -1; var colors = { bedroom: 0x87CEEB, kitchen: 0xFFB347, bathroom: 0x98FB98, livingroom: 0xDDA0DD }; var costs = { bedroom: 150, kitchen: 200, bathroom: 120, livingroom: 180 }; self.cost = costs[roomType]; var roomGraphics = self.attachAsset(roomType, { anchorX: 0.5, anchorY: 0.5 }); var roomText = new Text2(roomType.toUpperCase(), { size: 36, fill: 0x000000 }); roomText.anchor.set(0.5, 0.5); self.addChild(roomText); var costText = new Text2(self.cost + ' crystals', { size: 30, fill: 0x000000 }); costText.anchor.set(0.5, 0.5); costText.y = 45; self.addChild(costText); self.highlight = function () { roomGraphics.alpha = 0.8; tween(roomGraphics, { scaleX: 1.1, scaleY: 1.1 }, { duration: 200 }); }; self.unhighlight = function () { roomGraphics.alpha = 1.0; tween(roomGraphics, { scaleX: 1.0, scaleY: 1.0 }, { duration: 200 }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228B22 }); /**** * Game Code ****/ // Game constants var GRID_SIZE = 180; var GRID_ROWS = 6; var GRID_COLS = 8; var GRID_START_X = 450; var GRID_START_Y = 400; var SIDEBAR_WIDTH = 500; // Game variables var budget = 1000; var score = 0; var draggedRoom = null; var grid = []; var sidebarRooms = []; var placedRooms = []; var objectives = []; var completedObjectives = []; // UI elements var budgetText = new Text2('Crystals: ' + budget, { size: 80, fill: 0xFFFFFF }); budgetText.anchor.set(0, 0); budgetText.x = 120; budgetText.y = 50; LK.gui.topLeft.addChild(budgetText); var scoreText = new Text2('Score: ' + score, { size: 80, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); LK.gui.topRight.addChild(scoreText); var objectiveText = new Text2('Build blueberry a home!', { size: 60, fill: 0xFFFFFF }); objectiveText.anchor.set(0.5, 0); LK.gui.top.addChild(objectiveText); // Create sidebar var sidebar = game.attachAsset('sidebar', { anchorX: 0, anchorY: 0, x: 0, y: 0 }); var sidebarTitle = new Text2('ROOMS', { size: 60, fill: 0xFFFFFF }); sidebarTitle.anchor.set(0.5, 0); sidebarTitle.x = SIDEBAR_WIDTH / 2; sidebarTitle.y = 100; game.addChild(sidebarTitle); // Create room types in sidebar var roomTypes = ['bedroom', 'kitchen', 'bathroom', 'livingroom']; for (var i = 0; i < roomTypes.length; i++) { var room = new Room(roomTypes[i]); room.x = SIDEBAR_WIDTH / 2; room.y = 300 + i * 220; sidebarRooms.push(room); game.addChild(room); } // Create grid for (var row = 0; row < GRID_ROWS; row++) { grid[row] = []; for (var col = 0; col < GRID_COLS; col++) { var cell = new GridCell(col, row); cell.x = GRID_START_X + col * GRID_SIZE; cell.y = GRID_START_Y + row * GRID_SIZE; grid[row][col] = cell; game.addChild(cell); } } // Initialize objectives objectives = [{ text: 'Place a bedroom', type: 'place', roomType: 'bedroom', completed: false, points: 50 }, { text: 'Place a kitchen', type: 'place', roomType: 'kitchen', completed: false, points: 50 }, { text: 'Place a bathroom', type: 'place', roomType: 'bathroom', completed: false, points: 50 }, { text: 'Connect bathroom to bedroom', type: 'adjacent', room1: 'bathroom', room2: 'bedroom', completed: false, points: 100 }]; function updateBudgetDisplay() { budgetText.setText('Crystals: ' + budget); } function updateScoreDisplay() { scoreText.setText('Score: ' + score); } function updateObjectiveDisplay() { var incomplete = objectives.filter(function (obj) { return !obj.completed; }); if (incomplete.length > 0) { objectiveText.setText(incomplete[0].text); } else { objectiveText.setText('All objectives complete!'); } } function getGridPosition(x, y) { var col = Math.floor((x - GRID_START_X + GRID_SIZE / 2) / GRID_SIZE); var row = Math.floor((y - GRID_START_Y + GRID_SIZE / 2) / GRID_SIZE); if (col >= 0 && col < GRID_COLS && row >= 0 && row < GRID_ROWS) { return { col: col, row: row }; } return null; } function isValidPlacement(gridPos) { if (!gridPos) return false; return !grid[gridPos.row][gridPos.col].occupied; } function placeRoom(room, gridPos) { if (!isValidPlacement(gridPos) || budget < room.cost) { LK.getSound('error').play(); return false; } budget -= room.cost; score += 25; var cell = grid[gridPos.row][gridPos.col]; cell.setOccupied(room); room.x = cell.x; room.y = cell.y; room.isPlaced = true; room.gridX = gridPos.col; room.gridY = gridPos.row; placedRooms.push(room); // Hide text when room is placed for (var child = 0; child < room.children.length; child++) { if (room.children[child] instanceof Text2) { room.children[child].visible = false; } } // Create new room in sidebar var newRoom = new Room(room.roomType); newRoom.x = SIDEBAR_WIDTH / 2; newRoom.y = 300 + roomTypes.indexOf(room.roomType) * 220; sidebarRooms.push(newRoom); game.addChild(newRoom); updateBudgetDisplay(); updateScoreDisplay(); checkObjectives(); LK.getSound('place').play(); if (budget <= 0) { LK.setTimeout(function () { LK.showGameOver(); }, 1000); } return true; } function evaluateHouseDesign() { if (placedRooms.length < 4) return false; // Need at least 4 rooms // Check if we have all room types var roomTypesPlaced = {}; for (var i = 0; i < placedRooms.length; i++) { roomTypesPlaced[placedRooms[i].roomType] = true; } var hasAllTypes = roomTypes.every(function (type) { return roomTypesPlaced[type]; }); if (!hasAllTypes) return false; // Check for good adjacencies (kitchen near living room, bathroom near bedroom) var kitchenRoom = placedRooms.find(function (room) { return room.roomType === 'kitchen'; }); var livingRoom = placedRooms.find(function (room) { return room.roomType === 'livingroom'; }); var bathroomRoom = placedRooms.find(function (room) { return room.roomType === 'bathroom'; }); var bedroomRoom = placedRooms.find(function (room) { return room.roomType === 'bedroom'; }); var goodAdjacencies = 0; // Kitchen adjacent to living room if (kitchenRoom && livingRoom) { var dx = Math.abs(kitchenRoom.gridX - livingRoom.gridX); var dy = Math.abs(kitchenRoom.gridY - livingRoom.gridY); if (dx === 1 && dy === 0 || dx === 0 && dy === 1) { goodAdjacencies++; } } // Bathroom adjacent to bedroom if (bathroomRoom && bedroomRoom) { var dx = Math.abs(bathroomRoom.gridX - bedroomRoom.gridX); var dy = Math.abs(bathroomRoom.gridY - bedroomRoom.gridY); if (dx === 1 && dy === 0 || dx === 0 && dy === 1) { goodAdjacencies++; } } // Check for compact layout (all rooms should be reasonably close) var minX = Math.min.apply(Math, placedRooms.map(function (room) { return room.gridX; })); var maxX = Math.max.apply(Math, placedRooms.map(function (room) { return room.gridX; })); var minY = Math.min.apply(Math, placedRooms.map(function (room) { return room.gridY; })); var maxY = Math.max.apply(Math, placedRooms.map(function (room) { return room.gridY; })); var width = maxX - minX + 1; var height = maxY - minY + 1; var isCompact = width <= 3 && height <= 3; // House looks very good if: has all room types, has good adjacencies, and is compact return hasAllTypes && goodAdjacencies >= 2 && isCompact; } function checkObjectives() { for (var i = 0; i < objectives.length; i++) { var obj = objectives[i]; if (obj.completed) continue; if (obj.type === 'place') { var hasRoom = placedRooms.some(function (room) { return room.roomType === obj.roomType; }); if (hasRoom) { obj.completed = true; score += obj.points; updateScoreDisplay(); } } else if (obj.type === 'adjacent') { var room1 = placedRooms.find(function (room) { return room.roomType === obj.room1; }); var room2 = placedRooms.find(function (room) { return room.roomType === obj.room2; }); if (room1 && room2) { var dx = Math.abs(room1.gridX - room2.gridX); var dy = Math.abs(room1.gridY - room2.gridY); if (dx === 1 && dy === 0 || dx === 0 && dy === 1) { obj.completed = true; score += obj.points; updateScoreDisplay(); } } } } updateObjectiveDisplay(); // Check if house design is very good and reward crystals if (evaluateHouseDesign() && budget < 2000) { // Only reward once budget += 1000; updateBudgetDisplay(); // Flash effect to show reward LK.effects.flashScreen(0xFFD700, 1000); objectiveText.setText('Beautiful house! +1000 crystals bonus!'); LK.setTimeout(function () { updateObjectiveDisplay(); }, 3000); } // Check win condition var allComplete = objectives.every(function (obj) { return obj.completed; }); if (allComplete && score >= 400) { LK.setTimeout(function () { LK.showYouWin(); }, 1000); } } function handleMove(x, y, obj) { if (draggedRoom) { draggedRoom.x = x; draggedRoom.y = y; // Highlight valid drop zones var gridPos = getGridPosition(x, y); for (var row = 0; row < GRID_ROWS; row++) { for (var col = 0; col < GRID_COLS; col++) { grid[row][col].unhighlight(); } } if (gridPos && isValidPlacement(gridPos) && budget >= draggedRoom.cost) { grid[gridPos.row][gridPos.col].highlight(); } } } game.move = handleMove; game.down = function (x, y, obj) { // Check if clicking on a room in sidebar for (var i = 0; i < sidebarRooms.length; i++) { var room = sidebarRooms[i]; // Check if click position is within room bounds var roomLeft = room.x - 100; // room width/2 = 200/2 = 100 var roomRight = room.x + 100; var roomTop = room.y - 100; // room height/2 = 200/2 = 100 var roomBottom = room.y + 100; if (x >= roomLeft && x <= roomRight && y >= roomTop && y <= roomBottom) { if (budget >= room.cost) { draggedRoom = room; room.highlight(); // Remove from sidebar array but keep in game for dragging sidebarRooms.splice(i, 1); break; } } } }; game.up = function (x, y, obj) { if (draggedRoom) { var gridPos = getGridPosition(x, y); if (gridPos && placeRoom(draggedRoom, gridPos)) { // Successfully placed } else { // Return to sidebar draggedRoom.x = SIDEBAR_WIDTH / 2; draggedRoom.y = 300 + roomTypes.indexOf(draggedRoom.roomType) * 220; sidebarRooms.push(draggedRoom); } draggedRoom.unhighlight(); // Clear all highlights for (var row = 0; row < GRID_ROWS; row++) { for (var col = 0; col < GRID_COLS; col++) { grid[row][col].unhighlight(); } } draggedRoom = null; } }; game.update = function () { // Update LK score for leaderboard LK.setScore(score); };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var GridCell = Container.expand(function (gridX, gridY) {
var self = Container.call(this);
self.gridX = gridX;
self.gridY = gridY;
self.occupied = false;
self.room = null;
var cellGraphics = self.attachAsset('foundation', {
anchorX: 0.5,
anchorY: 0.5
});
cellGraphics.alpha = 0.3;
self.highlight = function () {
cellGraphics.alpha = 0.8;
cellGraphics.tint = 0x00FF00;
};
self.unhighlight = function () {
cellGraphics.alpha = 0.3;
cellGraphics.tint = 0xFFFFFF;
};
self.setOccupied = function (room) {
self.occupied = true;
self.room = room;
cellGraphics.alpha = 0.1;
};
return self;
});
var Room = Container.expand(function (roomType) {
var self = Container.call(this);
self.roomType = roomType;
self.isPlaced = false;
self.gridX = -1;
self.gridY = -1;
var colors = {
bedroom: 0x87CEEB,
kitchen: 0xFFB347,
bathroom: 0x98FB98,
livingroom: 0xDDA0DD
};
var costs = {
bedroom: 150,
kitchen: 200,
bathroom: 120,
livingroom: 180
};
self.cost = costs[roomType];
var roomGraphics = self.attachAsset(roomType, {
anchorX: 0.5,
anchorY: 0.5
});
var roomText = new Text2(roomType.toUpperCase(), {
size: 36,
fill: 0x000000
});
roomText.anchor.set(0.5, 0.5);
self.addChild(roomText);
var costText = new Text2(self.cost + ' crystals', {
size: 30,
fill: 0x000000
});
costText.anchor.set(0.5, 0.5);
costText.y = 45;
self.addChild(costText);
self.highlight = function () {
roomGraphics.alpha = 0.8;
tween(roomGraphics, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 200
});
};
self.unhighlight = function () {
roomGraphics.alpha = 1.0;
tween(roomGraphics, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 200
});
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x228B22
});
/****
* Game Code
****/
// Game constants
var GRID_SIZE = 180;
var GRID_ROWS = 6;
var GRID_COLS = 8;
var GRID_START_X = 450;
var GRID_START_Y = 400;
var SIDEBAR_WIDTH = 500;
// Game variables
var budget = 1000;
var score = 0;
var draggedRoom = null;
var grid = [];
var sidebarRooms = [];
var placedRooms = [];
var objectives = [];
var completedObjectives = [];
// UI elements
var budgetText = new Text2('Crystals: ' + budget, {
size: 80,
fill: 0xFFFFFF
});
budgetText.anchor.set(0, 0);
budgetText.x = 120;
budgetText.y = 50;
LK.gui.topLeft.addChild(budgetText);
var scoreText = new Text2('Score: ' + score, {
size: 80,
fill: 0xFFFFFF
});
scoreText.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreText);
var objectiveText = new Text2('Build blueberry a home!', {
size: 60,
fill: 0xFFFFFF
});
objectiveText.anchor.set(0.5, 0);
LK.gui.top.addChild(objectiveText);
// Create sidebar
var sidebar = game.attachAsset('sidebar', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0
});
var sidebarTitle = new Text2('ROOMS', {
size: 60,
fill: 0xFFFFFF
});
sidebarTitle.anchor.set(0.5, 0);
sidebarTitle.x = SIDEBAR_WIDTH / 2;
sidebarTitle.y = 100;
game.addChild(sidebarTitle);
// Create room types in sidebar
var roomTypes = ['bedroom', 'kitchen', 'bathroom', 'livingroom'];
for (var i = 0; i < roomTypes.length; i++) {
var room = new Room(roomTypes[i]);
room.x = SIDEBAR_WIDTH / 2;
room.y = 300 + i * 220;
sidebarRooms.push(room);
game.addChild(room);
}
// Create grid
for (var row = 0; row < GRID_ROWS; row++) {
grid[row] = [];
for (var col = 0; col < GRID_COLS; col++) {
var cell = new GridCell(col, row);
cell.x = GRID_START_X + col * GRID_SIZE;
cell.y = GRID_START_Y + row * GRID_SIZE;
grid[row][col] = cell;
game.addChild(cell);
}
}
// Initialize objectives
objectives = [{
text: 'Place a bedroom',
type: 'place',
roomType: 'bedroom',
completed: false,
points: 50
}, {
text: 'Place a kitchen',
type: 'place',
roomType: 'kitchen',
completed: false,
points: 50
}, {
text: 'Place a bathroom',
type: 'place',
roomType: 'bathroom',
completed: false,
points: 50
}, {
text: 'Connect bathroom to bedroom',
type: 'adjacent',
room1: 'bathroom',
room2: 'bedroom',
completed: false,
points: 100
}];
function updateBudgetDisplay() {
budgetText.setText('Crystals: ' + budget);
}
function updateScoreDisplay() {
scoreText.setText('Score: ' + score);
}
function updateObjectiveDisplay() {
var incomplete = objectives.filter(function (obj) {
return !obj.completed;
});
if (incomplete.length > 0) {
objectiveText.setText(incomplete[0].text);
} else {
objectiveText.setText('All objectives complete!');
}
}
function getGridPosition(x, y) {
var col = Math.floor((x - GRID_START_X + GRID_SIZE / 2) / GRID_SIZE);
var row = Math.floor((y - GRID_START_Y + GRID_SIZE / 2) / GRID_SIZE);
if (col >= 0 && col < GRID_COLS && row >= 0 && row < GRID_ROWS) {
return {
col: col,
row: row
};
}
return null;
}
function isValidPlacement(gridPos) {
if (!gridPos) return false;
return !grid[gridPos.row][gridPos.col].occupied;
}
function placeRoom(room, gridPos) {
if (!isValidPlacement(gridPos) || budget < room.cost) {
LK.getSound('error').play();
return false;
}
budget -= room.cost;
score += 25;
var cell = grid[gridPos.row][gridPos.col];
cell.setOccupied(room);
room.x = cell.x;
room.y = cell.y;
room.isPlaced = true;
room.gridX = gridPos.col;
room.gridY = gridPos.row;
placedRooms.push(room);
// Hide text when room is placed
for (var child = 0; child < room.children.length; child++) {
if (room.children[child] instanceof Text2) {
room.children[child].visible = false;
}
}
// Create new room in sidebar
var newRoom = new Room(room.roomType);
newRoom.x = SIDEBAR_WIDTH / 2;
newRoom.y = 300 + roomTypes.indexOf(room.roomType) * 220;
sidebarRooms.push(newRoom);
game.addChild(newRoom);
updateBudgetDisplay();
updateScoreDisplay();
checkObjectives();
LK.getSound('place').play();
if (budget <= 0) {
LK.setTimeout(function () {
LK.showGameOver();
}, 1000);
}
return true;
}
function evaluateHouseDesign() {
if (placedRooms.length < 4) return false; // Need at least 4 rooms
// Check if we have all room types
var roomTypesPlaced = {};
for (var i = 0; i < placedRooms.length; i++) {
roomTypesPlaced[placedRooms[i].roomType] = true;
}
var hasAllTypes = roomTypes.every(function (type) {
return roomTypesPlaced[type];
});
if (!hasAllTypes) return false;
// Check for good adjacencies (kitchen near living room, bathroom near bedroom)
var kitchenRoom = placedRooms.find(function (room) {
return room.roomType === 'kitchen';
});
var livingRoom = placedRooms.find(function (room) {
return room.roomType === 'livingroom';
});
var bathroomRoom = placedRooms.find(function (room) {
return room.roomType === 'bathroom';
});
var bedroomRoom = placedRooms.find(function (room) {
return room.roomType === 'bedroom';
});
var goodAdjacencies = 0;
// Kitchen adjacent to living room
if (kitchenRoom && livingRoom) {
var dx = Math.abs(kitchenRoom.gridX - livingRoom.gridX);
var dy = Math.abs(kitchenRoom.gridY - livingRoom.gridY);
if (dx === 1 && dy === 0 || dx === 0 && dy === 1) {
goodAdjacencies++;
}
}
// Bathroom adjacent to bedroom
if (bathroomRoom && bedroomRoom) {
var dx = Math.abs(bathroomRoom.gridX - bedroomRoom.gridX);
var dy = Math.abs(bathroomRoom.gridY - bedroomRoom.gridY);
if (dx === 1 && dy === 0 || dx === 0 && dy === 1) {
goodAdjacencies++;
}
}
// Check for compact layout (all rooms should be reasonably close)
var minX = Math.min.apply(Math, placedRooms.map(function (room) {
return room.gridX;
}));
var maxX = Math.max.apply(Math, placedRooms.map(function (room) {
return room.gridX;
}));
var minY = Math.min.apply(Math, placedRooms.map(function (room) {
return room.gridY;
}));
var maxY = Math.max.apply(Math, placedRooms.map(function (room) {
return room.gridY;
}));
var width = maxX - minX + 1;
var height = maxY - minY + 1;
var isCompact = width <= 3 && height <= 3;
// House looks very good if: has all room types, has good adjacencies, and is compact
return hasAllTypes && goodAdjacencies >= 2 && isCompact;
}
function checkObjectives() {
for (var i = 0; i < objectives.length; i++) {
var obj = objectives[i];
if (obj.completed) continue;
if (obj.type === 'place') {
var hasRoom = placedRooms.some(function (room) {
return room.roomType === obj.roomType;
});
if (hasRoom) {
obj.completed = true;
score += obj.points;
updateScoreDisplay();
}
} else if (obj.type === 'adjacent') {
var room1 = placedRooms.find(function (room) {
return room.roomType === obj.room1;
});
var room2 = placedRooms.find(function (room) {
return room.roomType === obj.room2;
});
if (room1 && room2) {
var dx = Math.abs(room1.gridX - room2.gridX);
var dy = Math.abs(room1.gridY - room2.gridY);
if (dx === 1 && dy === 0 || dx === 0 && dy === 1) {
obj.completed = true;
score += obj.points;
updateScoreDisplay();
}
}
}
}
updateObjectiveDisplay();
// Check if house design is very good and reward crystals
if (evaluateHouseDesign() && budget < 2000) {
// Only reward once
budget += 1000;
updateBudgetDisplay();
// Flash effect to show reward
LK.effects.flashScreen(0xFFD700, 1000);
objectiveText.setText('Beautiful house! +1000 crystals bonus!');
LK.setTimeout(function () {
updateObjectiveDisplay();
}, 3000);
}
// Check win condition
var allComplete = objectives.every(function (obj) {
return obj.completed;
});
if (allComplete && score >= 400) {
LK.setTimeout(function () {
LK.showYouWin();
}, 1000);
}
}
function handleMove(x, y, obj) {
if (draggedRoom) {
draggedRoom.x = x;
draggedRoom.y = y;
// Highlight valid drop zones
var gridPos = getGridPosition(x, y);
for (var row = 0; row < GRID_ROWS; row++) {
for (var col = 0; col < GRID_COLS; col++) {
grid[row][col].unhighlight();
}
}
if (gridPos && isValidPlacement(gridPos) && budget >= draggedRoom.cost) {
grid[gridPos.row][gridPos.col].highlight();
}
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
// Check if clicking on a room in sidebar
for (var i = 0; i < sidebarRooms.length; i++) {
var room = sidebarRooms[i];
// Check if click position is within room bounds
var roomLeft = room.x - 100; // room width/2 = 200/2 = 100
var roomRight = room.x + 100;
var roomTop = room.y - 100; // room height/2 = 200/2 = 100
var roomBottom = room.y + 100;
if (x >= roomLeft && x <= roomRight && y >= roomTop && y <= roomBottom) {
if (budget >= room.cost) {
draggedRoom = room;
room.highlight();
// Remove from sidebar array but keep in game for dragging
sidebarRooms.splice(i, 1);
break;
}
}
}
};
game.up = function (x, y, obj) {
if (draggedRoom) {
var gridPos = getGridPosition(x, y);
if (gridPos && placeRoom(draggedRoom, gridPos)) {
// Successfully placed
} else {
// Return to sidebar
draggedRoom.x = SIDEBAR_WIDTH / 2;
draggedRoom.y = 300 + roomTypes.indexOf(draggedRoom.roomType) * 220;
sidebarRooms.push(draggedRoom);
}
draggedRoom.unhighlight();
// Clear all highlights
for (var row = 0; row < GRID_ROWS; row++) {
for (var col = 0; col < GRID_COLS; col++) {
grid[row][col].unhighlight();
}
}
draggedRoom = null;
}
};
game.update = function () {
// Update LK score for leaderboard
LK.setScore(score);
};