Question
Maze Game - Version 2! In the real world You need a method called checkValidPosition. It should take in as parameters the current 2D array
Maze Game - Version 2! In the "real world" You need a method called checkValidPosition. It should take in as parameters the current 2D array and two ints - one that represents the new X position and one that represents the new Y position of the Player. It should determine if the new position is valid (within the bounds of the array), and return a boolean TRUE or FALSE to the Main method. This function should be used to replace the code that was previously used to do this work in your code from Assignment 5B. You need a method called checkGameStatus. It should take in as parameters the current 2D array and two ints that represent the X/Y position of the player. It should determine if the player is on the path or has won or lost the game. It should return an integer to the Main method that represents each state: Returning 0 means the player has lost Returning 1 means the player is still playing the game Returning 2 means the player has won the game. This function should be used to replace the code that was previously used to do this work in your code from Assignment 5B. You need a method called printMaze. It should take in as parameters the current 2D array. It should print the maze to the screen; it should not return any value to the Main method.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here are the methods checkValidPosition checkGameStatus and printMaze implemented in Java public cla...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