jaenewjersey.blogg.se

Java adventure action games
Java adventure action games





Include a function to get and set this location and you can now set and access the current location of the character. You can then have a variable within your player class such as "currentRoom", or "location". You already have a Room object, so is it really necessary to store the X/Y co-ordinates of each Room? You can create a structure of Room objects which are linked to each other via the North/South/East/West Room objects (if applicable). I have to set the room location to 0,0 so that a description in the map class will print out. Public Room(String description, boolean north, boolean south, boolean east,īoolean west, boolean isDark, Lamp theLamp, Key theKey, * Yall don't haveta worry 'bout me for this'ere game, but look me up in * sometimes without even trying, knowwhatimssayin? * Returns true if there is no light in this room, * Sets the key variable in this room to null * Sets the lamp variable in this room to null * Returns true if the player can go west from this room * Returns true if the player can go east from this room * Returns true if the player can go south from this room * Returns true if the player can go north from this room * Returns the text description of this room here is what i have so far in my room and adventure class. I need to set the players room location to and i can't figure out how. These have all been tested and are correct so now I am writing my adventure class which is the driver for the program. In my game there are several class I have written including room, lamp, chest, java, player, key and map.







Java adventure action games