Board Thread:Questions and Answers/@comment-26944223-20150301140550/@comment-24006222-20150315031500

Here's another thing you need to know ... about writing a text-based adventure. You need to keep track of where you are. That is, you need to know what is going on at any point in the game. So there are a large number of things to track. Let's see .... How about, first, where are you. Simplest is an x-y grid. You have to have two variables, one which will hold x and one which will hold y. Say you start the player out at 5,5. When the player types, "W" or "West" then you will have to take 1 away from the x value, so in this case that the player goes to 4,5. Similarly, player says "S" or "South" and you increase y by 1, in this case player goes to 4,6. Also ... what is player holding? That would be a list of items. This can be free-form, so you need an "array" of string character [look up DIM statement], say, "INVENTORY$(x)" where X is the item number. Also, you need to know what is in the "grid" and that will be a 2-dimensional array. So "GRID$(5,5)" can be "Library". Player types in, "Where?" or "Where" or "Where am I?" and program spits out, "You are at 5,5 in the Library". That grid needs to be pre-loaded. [Look up DATA and READ statements.]  That's enough for now.