Question
Java: Making a simple tiled map, based on a coordinate plane. Limitations: ? 2 classes ? A third class to test them ? A main
Java: Making a simple tiled map, based on a coordinate plane.
Limitations: ? 2 classes ? A third class to test them ? A main method
Assume the X and Y axis will have 16 points from each direction of the 0,0 middle coordinate (including negative points)
In the classes: ? Create the map as a whole ? Use one class to create the map, which will also define how large the map is ? Use the other class to be each "cell" or coordinate of the map ? Specify where the current position is ? Change the current position ? Set an initial starting position (also provide a default starting position if the target position is out of bounds) ? Determine which direction needs to be travelled to get from A to B ? Keep notes about each cell in the map and to retrace a path travelled.
Example Output: Welcome! What coordinates are you at now? Enter the X coordinate: 2 Enter the Y coordinate: -2 Okay, you are at position (2,-2), what would you like to do now? 1. Move to a new position. 2. Calculate the direction of a new position. 3. Make a note about the current position. 4. Retrace your steps. 5. Exit. 2 Enter the x coordinate of the position youd like to find the direction to: 0 Enter the y coordinate of the position youd like to find the direction to: 0 To travel from (2,-2) to (0,0) you need to move: SW Okay, you are at position (2,-2), what would you like to do now? 1. Move to a new position. 2. Calculate the direction of a new position. 3. Make a note about the current position. 4. Retrace your steps. 5. Exit. 1 Enter the x coordinate youd like to move to: 0 Enter the y coordinate youd like to move to: 0 Okay, you are at position (0,0), what would you like to do now? 1. Move to a new position. 2. Calculate the direction of a new position. 3. Make a note about the current position. 4. Retrace your steps. 5. Exit. 5 Farewell!
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