Menu
Coddy logo textTech

Project Setup: The Room

Part of the Logic & Flow section of Coddy's Lua journey. Lesson 24 of 54.

challenge icon

Challenge

Easy

You're about to start building a text adventure game: a classic style of interactive fiction where players explore different locations by typing commands. Over the next several lessons, you'll create the foundation for this game piece by piece.

Create a table representing the starting room of your text adventure game. The room should have three fields: a name, a description, and an empty exits table.

Store the room in a variable called startingRoom with the following details:

  • name: "Ancient Library"
  • description: "You find yourself in a dusty library filled with ancient books and scrolls."
  • exits: An empty table (to be filled in future lessons)

Print the room's name and description on separate lines.

Expected Output Format:

Ancient Library
You find yourself in a dusty library filled with ancient books and scrolls.

Try it yourself

All lessons in Logic & Flow

Practice on your own: Online Lua compiler