Answered step by step
Verified Expert Solution
Question
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 taillight 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.floorgetGoalX
let goalTileY Math.floorgetGoalY
Take the pixel coordinates, divide by the fact tiles are pixels wide, and round down because we were given the coordinate of the middle of the square.
Or shortcut: it's always in tile
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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