You just need to make this method accessible for the scanner. Probably you will already have similar method, used by your deep game logic. This is however only necessary if you messed a before. Either you create a new Method to accomplish this, looping through a list of items, handling the adding etc. i.E you want the player to be able to give himself an item over /give. The only possible way to make it a little easier is to make your common game methods general so that you can "call" them from the console. this is a common problem and sadly there is not a big workaround. Again, store the item the player has in an ArrayListģ. if necessary create subclasses using inheriting. (i.E Room room1 = new Room("Cell", 1,1), Room room2 = new Room("Dungeon",1,2)) I would store the rooms in an ArrayListĢ. Then you can turn each room in a new object of the same class. Create one class Room which either holds most or all of the datafields you require for a room. This would somehow miss the point of classes and objects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |