In the game you move within and between rooms using the "wasd" keys. You need to hit enter after each key - later we will see a way to avoid this when we create a JavaFX window. Typing "i" shows your...


In the game you move within and between rooms using the "wasd" keys. You need to hit enter after each key - later we will see a way to avoid this when we create a JavaFX window. Typing "i" shows your inventory (and consumes a turn) and typing "q" quits the game.


You can use either:
NetBeans project folder with codeRPGOOP-NB.zip

or straight codeRPGOOP.zip

Start by compiling and running the game to see how it is played and this will give you an idea how the code is organized. Part of this assignment is for you to figure out how existing code works (a common occurrence for real-world jobs!) but here is a quick run-down. More details are in comments in the code:

  • Room objects are connected to up to 4 other Room objects in the north, south, east, or west. The main class in RPGOOP.java makes all of the rooms and connects them. The rooms are named after famous computer scientists. A room is of a specified dimension and contains an ArrayList of items in the room, and an ArrayList of Character objects in the room. The Character objects should be the monsters.

  • The Character class is the base class for Player, GrayOoze (computer Non-Player Character or NPC), and Vampire (computer NPC). Characters can make a move in their room which may involve attacking another player. The human player can attack, move to blank squares, move to other rooms, pick up items, or interact with special items.

  • The Item class is the base class for CollectibleItem, KnuthItem, RoundDoorItem, and TriviaItem. An item can be picked up (CollectibleItem) otherwise it is special. Special items are used to block entry to another room or for something else special to happen. The player must fulfill the conditionsSatisfied method for special items to be removed.

To do: After you have a feel for how the code works (you can ask others or the instructor for help if needed, but you should do your own programming) then implement the following:

  1. Create a new room with the name of your choice and link it to the west of the Turing room.

  2. Create a new special item, MiniGame, and place it on the door to your new room. To satisfy the special condition to pass, the player must complete a mini game. How the mini game is played is up to you. Possible examples include a round of blackjack dice, rock/scissors/paper, pick up sticks (where picking up the last stick loses), or the game of your choice.

  3. Create a new weapon item in your new room. Modify the Player class so if the player has this weapon then the player can inflict up to 30 damage.

  4. Create a new NPC Character, Zombie. With a 50% chance the zombie should move toward the first (and only) player passed in the opponents array and always attack the player if adjacent. If the zombie is not adjacent and not moving toward the player, then the other 50% of the moves the zombie should not move at all. You can choose how much damage the zombie inflicts and how many hit points it has. Put the zombie in the vonNeumann room.

Feb 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here