User prompt
separate the total number of rooms in each hotel
Code edit (1 edits merged)
Please save this source code
User prompt
Hotel Room Builder
Initial prompt
BEGIN GAME LOOP HANDLE USER INPUT IF Right Arrow Key Pressed: MOVE to NEXT Hotel (Cyclic: Hotel 1 -> 2 -> 3 -> 4 -> 5 -> 1) IF Left Arrow Key Pressed: MOVE to PREVIOUS Hotel (Cyclic: Hotel 1 -> 5 -> 4 -> 3 -> 2 -> 1) IF 'Add Room' Button Pressed (or equivalent key): IF Current Hotel has < 10 total rooms (across all hotels): ADD 1 Room to Current Hotel UPDATE GAME STATE UPDATE Display to show Current Hotel UPDATE Display to show Rooms in Current Hotel UPDATE Display to show Total Rooms (across all hotels) RENDER GRAPHICS DRAW Current Hotel Scene DRAW UI elements (Room Count, Hotel Name, etc.) END GAME LOOP
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 });
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
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