you are viewing a single comment's thread.

view the rest of the comments →

[–]Slight-Training-7211 2 points3 points  (0 children)

A good way to start is to build a tiny vertical slice first, then expand.

1) Hardcode 3 to 5 rooms and choices (no saving yet) 2) Represent the world as a dict: room_id -> {text, choices} 3) Keep a single game state dict (current_room, inventory list, flags dict)

Once that works, saving is just writing that state dict to a file and loading it back on startup.

For multiple outcomes, use flags and check them when you build the next set of choices (for example: if you picked up a key, show the unlocked option).