User prompt
It seems very artificial that customers do not arrive at a constant speed.
User prompt
You can only hold 1 customer in each room. When a new customer arrives, an angry word bubble will appear above them and they will leave. They will give a low score when they leave. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Match the room location used by incoming customers.
User prompt
Create two images: a full room and an empty room.
User prompt
show rooms as empty and occupied
User prompt
creating space between rooms to the right and left.
User prompt
creating space between rooms to the right and left.
User prompt
Give each incoming customer a scoring task ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Create a hotel rating system so that guests can give a score out of 5. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
move add room button below hotel
User prompt
center hotel room and directional keys vertically on the screen
User prompt
make the room price 10 dollars
User prompt
The arrangement of the rooms is arranged in a 3x6 pattern
User prompt
Open the rooms in every direction
User prompt
Fitting the room layout in 3x3x3 format equal to the hotel's dimensions
User prompt
Increase the number of rooms from 10 to 12
User prompt
prevent rooms from overlapping
User prompt
Let the customer come from outside the screen ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When you add a room, it will be deducted from the budget.
User prompt
Let's add $200 for each room
User prompt
Write the hotel budget on the top left, let's start with 1000 dollars
User prompt
Customers coming to the hotel can go to the grocery store. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
add grocery store to bottom of screen
User prompt
A maximum of 10 rooms can be added to each hotel.
User prompt
bringing the total number of rooms to 50.
/**** * Classes ****/ var AddRoomButton = Container.expand(function () { var self = Container.call(this); var buttonBg = self.attachAsset('add_room_button', { anchorX: 0.5, anchorY: 0.5 }); self.buttonText = self.addChild(new Text2('Add Room', { size: 50, fill: 0xFFFFFF })); self.buttonText.anchor.set(0.5, 0.5); self.down = function (x, y, obj) { if (totalRooms < 50) { if (hotels[currentHotelIndex].addRoom()) { totalRooms++; hotelCounts[currentHotelIndex]++; updateUI(); } } }; self.updateButton = function () { if (totalRooms >= 50) { buttonBg.tint = 0x666666; self.buttonText.setText('Limit Reached'); } else { buttonBg.tint = 0xffffff; self.buttonText.setText('Add Room'); } }; return self; }); var Hotel = Container.expand(function () { var self = Container.call(this); // Hotel background var hotelBg = self.attachAsset('hotel_bg', { anchorX: 0.5, anchorY: 0.5 }); // Properties self.hotelId = 1; self.roomCount = 0; self.rooms = []; self.setHotel = function (id) { self.hotelId = id; self.updateDisplay(); }; self.addRoom = function () { if (self.roomCount < 5) { // Max 5 rooms per hotel for visual purposes var room = self.addChild(LK.getAsset('room', { anchorX: 0.5, anchorY: 0.5 })); // Position rooms in a grid var col = self.roomCount % 3; var row = Math.floor(self.roomCount / 3); room.x = (col - 1) * 90; room.y = (row - 1) * 70; self.rooms.push(room); self.roomCount++; return true; } return false; }; self.updateDisplay = function () { // Clear existing rooms for (var i = 0; i < self.rooms.length; i++) { self.rooms[i].destroy(); } self.rooms = []; // Add rooms based on current count for (var i = 0; i < self.roomCount; i++) { var room = self.addChild(LK.getAsset('room', { anchorX: 0.5, anchorY: 0.5 })); var col = i % 3; var row = Math.floor(i / 3); room.x = (col - 1) * 90; room.y = (row - 1) * 70; self.rooms.push(room); } }; return self; }); var NavigationButton = Container.expand(function () { var self = Container.call(this); var buttonBg = self.attachAsset('nav_button', { anchorX: 0.5, anchorY: 0.5 }); self.isLeft = true; self.buttonText = null; self.setText = function (text) { if (self.buttonText) { self.buttonText.destroy(); } self.buttonText = self.addChild(new Text2(text, { size: 40, fill: 0xFFFFFF })); self.buttonText.anchor.set(0.5, 0.5); }; self.down = function (x, y, obj) { if (self.isLeft) { currentHotelIndex = (currentHotelIndex - 1 + 5) % 5; } else { currentHotelIndex = (currentHotelIndex + 1) % 5; } updateHotelDisplay(); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2c3e50 }); /**** * Game Code ****/ // Game state variables var hotels = []; var currentHotelIndex = 0; var totalRooms = 0; var hotelCounts = [0, 0, 0, 0, 0]; // UI elements var hotelNameText; var currentRoomsText; var totalRoomsText; var leftButton; var rightButton; var addRoomButton; var currentHotel; // Initialize hotels for (var i = 0; i < 5; i++) { hotels.push(new Hotel()); } // Initialize hotel counts to match hotel room counts for (var i = 0; i < 5; i++) { hotelCounts[i] = hotels[i].roomCount; } // Position current hotel in center currentHotel = game.addChild(hotels[0]); currentHotel.x = 1024; currentHotel.y = 900; // Create navigation buttons leftButton = game.addChild(new NavigationButton()); leftButton.isLeft = true; leftButton.setText('<'); leftButton.x = 400; leftButton.y = 900; rightButton = game.addChild(new NavigationButton()); rightButton.isLeft = false; rightButton.setText('>'); rightButton.x = 1648; rightButton.y = 900; // Create add room button addRoomButton = game.addChild(new AddRoomButton()); addRoomButton.x = 1024; addRoomButton.y = 1400; // Create UI text elements hotelNameText = new Text2('Hotel 1', { size: 80, fill: 0xFFFFFF }); hotelNameText.anchor.set(0.5, 0); LK.gui.top.addChild(hotelNameText); hotelNameText.y = 150; currentRoomsText = new Text2('Rooms in this hotel: 0', { size: 50, fill: 0xFFFFFF }); currentRoomsText.anchor.set(0.5, 0); LK.gui.top.addChild(currentRoomsText); currentRoomsText.y = 250; totalRoomsText = new Text2('Total rooms: 0/50', { size: 50, fill: 0xFFFFFF }); totalRoomsText.anchor.set(0.5, 0); LK.gui.top.addChild(totalRoomsText); totalRoomsText.y = 320; function updateHotelDisplay() { // Remove current hotel game.removeChild(currentHotel); // Add new hotel currentHotel = game.addChild(hotels[currentHotelIndex]); currentHotel.x = 1024; currentHotel.y = 900; currentHotel.setHotel(currentHotelIndex + 1); updateUI(); } function updateUI() { hotelNameText.setText('Hotel ' + (currentHotelIndex + 1)); currentRoomsText.setText('Rooms in this hotel: ' + hotelCounts[currentHotelIndex]); totalRoomsText.setText('Total rooms: ' + totalRooms + '/50'); addRoomButton.updateButton(); } // Update hotel counts when rooms are added function updateHotelCounts() { totalRooms = 0; for (var i = 0; i < 5; i++) { hotelCounts[i] = hotels[i].roomCount; totalRooms += hotelCounts[i]; } } game.update = function () { updateHotelCounts(); }; // Initialize UI updateUI();
/****
* Classes
****/
var AddRoomButton = Container.expand(function () {
var self = Container.call(this);
var buttonBg = self.attachAsset('add_room_button', {
anchorX: 0.5,
anchorY: 0.5
});
self.buttonText = self.addChild(new Text2('Add Room', {
size: 50,
fill: 0xFFFFFF
}));
self.buttonText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
if (totalRooms < 50) {
if (hotels[currentHotelIndex].addRoom()) {
totalRooms++;
hotelCounts[currentHotelIndex]++;
updateUI();
}
}
};
self.updateButton = function () {
if (totalRooms >= 50) {
buttonBg.tint = 0x666666;
self.buttonText.setText('Limit Reached');
} else {
buttonBg.tint = 0xffffff;
self.buttonText.setText('Add Room');
}
};
return self;
});
var Hotel = Container.expand(function () {
var self = Container.call(this);
// Hotel background
var hotelBg = self.attachAsset('hotel_bg', {
anchorX: 0.5,
anchorY: 0.5
});
// Properties
self.hotelId = 1;
self.roomCount = 0;
self.rooms = [];
self.setHotel = function (id) {
self.hotelId = id;
self.updateDisplay();
};
self.addRoom = function () {
if (self.roomCount < 5) {
// Max 5 rooms per hotel for visual purposes
var room = self.addChild(LK.getAsset('room', {
anchorX: 0.5,
anchorY: 0.5
}));
// Position rooms in a grid
var col = self.roomCount % 3;
var row = Math.floor(self.roomCount / 3);
room.x = (col - 1) * 90;
room.y = (row - 1) * 70;
self.rooms.push(room);
self.roomCount++;
return true;
}
return false;
};
self.updateDisplay = function () {
// Clear existing rooms
for (var i = 0; i < self.rooms.length; i++) {
self.rooms[i].destroy();
}
self.rooms = [];
// Add rooms based on current count
for (var i = 0; i < self.roomCount; i++) {
var room = self.addChild(LK.getAsset('room', {
anchorX: 0.5,
anchorY: 0.5
}));
var col = i % 3;
var row = Math.floor(i / 3);
room.x = (col - 1) * 90;
room.y = (row - 1) * 70;
self.rooms.push(room);
}
};
return self;
});
var NavigationButton = Container.expand(function () {
var self = Container.call(this);
var buttonBg = self.attachAsset('nav_button', {
anchorX: 0.5,
anchorY: 0.5
});
self.isLeft = true;
self.buttonText = null;
self.setText = function (text) {
if (self.buttonText) {
self.buttonText.destroy();
}
self.buttonText = self.addChild(new Text2(text, {
size: 40,
fill: 0xFFFFFF
}));
self.buttonText.anchor.set(0.5, 0.5);
};
self.down = function (x, y, obj) {
if (self.isLeft) {
currentHotelIndex = (currentHotelIndex - 1 + 5) % 5;
} else {
currentHotelIndex = (currentHotelIndex + 1) % 5;
}
updateHotelDisplay();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2c3e50
});
/****
* Game Code
****/
// Game state variables
var hotels = [];
var currentHotelIndex = 0;
var totalRooms = 0;
var hotelCounts = [0, 0, 0, 0, 0];
// UI elements
var hotelNameText;
var currentRoomsText;
var totalRoomsText;
var leftButton;
var rightButton;
var addRoomButton;
var currentHotel;
// Initialize hotels
for (var i = 0; i < 5; i++) {
hotels.push(new Hotel());
}
// Initialize hotel counts to match hotel room counts
for (var i = 0; i < 5; i++) {
hotelCounts[i] = hotels[i].roomCount;
}
// Position current hotel in center
currentHotel = game.addChild(hotels[0]);
currentHotel.x = 1024;
currentHotel.y = 900;
// Create navigation buttons
leftButton = game.addChild(new NavigationButton());
leftButton.isLeft = true;
leftButton.setText('<');
leftButton.x = 400;
leftButton.y = 900;
rightButton = game.addChild(new NavigationButton());
rightButton.isLeft = false;
rightButton.setText('>');
rightButton.x = 1648;
rightButton.y = 900;
// Create add room button
addRoomButton = game.addChild(new AddRoomButton());
addRoomButton.x = 1024;
addRoomButton.y = 1400;
// Create UI text elements
hotelNameText = new Text2('Hotel 1', {
size: 80,
fill: 0xFFFFFF
});
hotelNameText.anchor.set(0.5, 0);
LK.gui.top.addChild(hotelNameText);
hotelNameText.y = 150;
currentRoomsText = new Text2('Rooms in this hotel: 0', {
size: 50,
fill: 0xFFFFFF
});
currentRoomsText.anchor.set(0.5, 0);
LK.gui.top.addChild(currentRoomsText);
currentRoomsText.y = 250;
totalRoomsText = new Text2('Total rooms: 0/50', {
size: 50,
fill: 0xFFFFFF
});
totalRoomsText.anchor.set(0.5, 0);
LK.gui.top.addChild(totalRoomsText);
totalRoomsText.y = 320;
function updateHotelDisplay() {
// Remove current hotel
game.removeChild(currentHotel);
// Add new hotel
currentHotel = game.addChild(hotels[currentHotelIndex]);
currentHotel.x = 1024;
currentHotel.y = 900;
currentHotel.setHotel(currentHotelIndex + 1);
updateUI();
}
function updateUI() {
hotelNameText.setText('Hotel ' + (currentHotelIndex + 1));
currentRoomsText.setText('Rooms in this hotel: ' + hotelCounts[currentHotelIndex]);
totalRoomsText.setText('Total rooms: ' + totalRooms + '/50');
addRoomButton.updateButton();
}
// Update hotel counts when rooms are added
function updateHotelCounts() {
totalRooms = 0;
for (var i = 0; i < 5; i++) {
hotelCounts[i] = hotels[i].roomCount;
totalRooms += hotelCounts[i];
}
}
game.update = function () {
updateHotelCounts();
};
// Initialize UI
updateUI();
stickman top view. In-Game asset
empty room top view. In-Game asset. 2d. High contrast. No shadows
full room top view. In-Game asset. 2d. High contrast. No shadows
left arrow. In-Game asset
destroyed and damaged red flag cross the stripe
Hotel wall view from the front with flowers and mosses. In-Game asset
16:9
Building silhouettes. In-Game asset
hotel bar top view. In-Game asset