Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Social Media Marketing

Authors: Tracy L Tuten, Michael R Solomon

3rd Edition

1526424541, 9781526424549

More Books

Students also viewed these Programming questions

Question

(1 point) Write the following numbers in the polar form re^(i), 0

Answered: 1 week ago

Question

Why should brands develop hygiene, hub, and hero content?

Answered: 1 week ago