Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

In the challenge levels, you need to write java script program for Bumper to map and solve the maze, go back to the start, and

In the challenge levels, you need to write java script program for Bumper to map and solve the maze, go back to the start, and then race to the middle again.
So it's more visible what Bumper is doing:
When Bumper is exploring and mapping the maze, set the tail-light blue
When Bumper is returning to the start square, set it red
When Bumper is racing to the middle, set it green
There are a few maps for you to try your program on. You should use the same program for Bumper, we've just given you a few different mazes to try it out on.
Note, though, that the score isn't dependent on how many mazes you can solve, it's based on how your robot performs in one maze. (It picks up points for moving, turning corners, finding its way to the middle, etc.) We just don't tell you which one we'll try it out in.
One more thing: You're going to need to know how Bumper can find out where the goal is. The pixel coordinates of the goal can be found with getGoalX() and getGoalY(), but you just need to get Bumper into the right tile.
The tile index of that can be found with
let goalTileX = Math.floor(getGoalX()/64)
let goalTileY = Math.floor(getGoalY()/64)
(Take the pixel coordinates, divide by the fact tiles are 64 pixels wide, and round down because we were given the coordinate of the middle of the square.)
Or, shortcut: it's always in tile (5,5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions