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

1 Expert Approved Answer
Step: 1 Unlock

Here are the methods checkValidPosition checkGameStatus and printMaze implemented in Java public cla... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!