View Single Post
Coda Coda is offline
Developer
Default   #11  
Well, I started writing code when I was 5. I wasn't good at it, mind you; I started off retyping and modifying examples out of books and then built up from there, putting together the pieces I had learned to make new things. There's a reason that game's code was so hard to manage and why I wished I knew a better way to do it.

The typical way you'd build this kind of thing is to define a data structure. Consider something like this:

Code:
rooms = {
  "Entrance": {
    "description": "You're in the entrance.",
    "exits": {
      "north": "Hallway"
    },
  },
  "Hallway": {
    # and so on
  }
  # and so on
}
Games by Coda (updated 4/8/2025 - New game: Marianas Miner)
Art by Coda (updated 8/25/2022 - beatBitten and All-Nighter Simulator)

Mega Man: The Light of Will (Mega Man / Green Lantern crossover: In the lead-up to the events of Mega Man 2, Dr. Wily has discovered emotional light technology. How will his creations change how humankind thinks about artificial intelligence? Sadly abandoned. Sufficient Velocity x-post)
Old Posted 09-04-2017, 08:09 PM Reply With Quote