Menu
CoddyTech

项目设置:房间

本课属于 Coddy Lua 学习旅程的“逻辑与流程”单元。第 24 课,共 54 课。

challenge icon

挑战

简单

你即将开始制作一款文字冒险游戏:这是一种经典的互动小说,玩家通过输入命令探索不同地点。在接下来的几课中,你会逐步为这款游戏搭建基础。

创建一个表示文字冒险游戏起始房间的表。这个房间应包含三个字段:名称、描述和一个空的出口表。

将房间存储在名为 startingRoom 的变量中,详情如下:

  • name:"Ancient Library"
  • description:"You find yourself in a dusty library filled with ancient books and scrolls."
  • exits:一个空表(将在后续课程中填充)

分别在单独的行中打印房间的名称和描述。

预期输出格式:

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

亲手试试

逻辑与流程中的所有课

自己练习: Lua 在线编译器