Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java program to implement a simple text based RPG (Role Playing Game). This program will exercise the use of inheritance and polymorphism. You
Write a Java program to implement a simple text based RPG (Role Playing Game). This program will exercise the use of inheritance and polymorphism. You will need an abstract class call Actor. The pseudo code for class Actor will be provided down below. You will have two child classes Player and Chicken that inherit from Actor. The program will implement a class Map as a 9x9 matrix of char. The Player should begin at the center of the map and be represented as P. You should randomly place the Chicken, represented as C on the Map. An empty slot can be represented as " ". Following is the example starting output: ! !! ! ! ! ! ! III I II !!O!!!!! ! !! !! !! ! !! ! ! ! ! 1 1 1 1 1 1 1 1 I 1 I I III ! !! !! !! ! ! ! 1 !! ! ! ! up: w | down:s | left:a | right:d | quit:9 your move: The Player should be able to move around the Map using wasd" buttons for moving up, down, left, right. Tying "q" will quit the program. If the player attempts to move off the Map, the player should not be able to move off the map (Consider border check!). The Chicken will also able to move after the player is moved. The chicken also can only move up, down, left right direction RANDOMLY (w/o any console input). Also consider border check on the Chicken
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started