Question: id Create a came where you are an X trying to get to the final goal, O. Your game should have at least one method

 id Create a came where you are an X trying toget to the final goal, O. Your game should have at least

id Create a came where you are an X trying to get to the final goal, O. Your game should have at least one method The method should draw the gameboard. Below is the setup of the initial gameboard. o Create a 6 x 15 array as the gameboard. o Place the play at 0,0. Denote the player with X. o Place the goal at 5,10. Denote the goal with O. o Denote all unoccupied spaces with an underscore o Place 3 obstacles on the gameboard. The player cannot go on these spaces. If a player attempts to moves on these spaces, the player must remain in its current space. Denote the obstacles with I. You may choose to place the obstacles anywhere on the board, except where the player and goal are when the game begins. Your obstacles will remain in the sam place for the duration of the game. Do not place obstacles around the player or goal when the game begins. o For this example, the obstacles are in positions 0,14; 2,3 and 4,6 ame X - 1 !! - 11 . At each round, the player chooses to move in the X or Y direction by entering 4, 8, 6, or 2. o 4 is going one space left o 8 is going one space up o 6 is going one space right o 2 is going 1 space down You may assume that a player will not attempt to move beyond the borders of the game. For example, if the player is in the far left position, you may assume the player will not enter a 4 to move left. The game must count the number of steps" that the player takes to get to the goal. Steps are the number of moves the player makes. Note: If the player stays in the same location, a step is not counted. The game ends when the player reaches the goal. When the game ends, give a goodbye message and the total number of steps taken. Be sure to prompt the user at the start of each round. You may use any prompts that you want! You must redraw the gameboard in each round by calling the method you created to make the gameboard. . id Create a came where you are an X trying to get to the final goal, O. Your game should have at least one method The method should draw the gameboard. Below is the setup of the initial gameboard. o Create a 6 x 15 array as the gameboard. o Place the play at 0,0. Denote the player with X. o Place the goal at 5,10. Denote the goal with O. o Denote all unoccupied spaces with an underscore o Place 3 obstacles on the gameboard. The player cannot go on these spaces. If a player attempts to moves on these spaces, the player must remain in its current space. Denote the obstacles with I. You may choose to place the obstacles anywhere on the board, except where the player and goal are when the game begins. Your obstacles will remain in the sam place for the duration of the game. Do not place obstacles around the player or goal when the game begins. o For this example, the obstacles are in positions 0,14; 2,3 and 4,6 ame X - 1 !! - 11 . At each round, the player chooses to move in the X or Y direction by entering 4, 8, 6, or 2. o 4 is going one space left o 8 is going one space up o 6 is going one space right o 2 is going 1 space down You may assume that a player will not attempt to move beyond the borders of the game. For example, if the player is in the far left position, you may assume the player will not enter a 4 to move left. The game must count the number of steps" that the player takes to get to the goal. Steps are the number of moves the player makes. Note: If the player stays in the same location, a step is not counted. The game ends when the player reaches the goal. When the game ends, give a goodbye message and the total number of steps taken. Be sure to prompt the user at the start of each round. You may use any prompts that you want! You must redraw the gameboard in each round by calling the method you created to make the gameboard

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!