I have a very simple game where items are added to rooms in the following manner:
basement.add(box)
box is an Item that was declared earlier.
I've been looking around for a way to be able to have the initial items stored in a file. For example, if I had this in the text file:
basement,box
basement,lamp
What would be the best way to translate this to
basement.add(box);
basement.add(lamp);
When the program runs?
Any help is appreciated. Thanks.


LinkBack URL
About LinkBacks
Reply With Quote
), and that "String fileLocation" should actually be a filepath, for example: "My Documents/codefiles/basement.txt" could be used for your file, so you know where it is and what it's called.