Please using java to make a program for these problem andexplain the steps as well. Thanks!
Today we are going to use the Detector and UserShape class fromActivity 5.3, Shapes and Games. You are going to create a simpleintelligent program that drives a spaceship back to homebase.Remember how you created the spaceship. UserShape spaceShip = newUserShape(Detector.TRIANGLE, xCenter, yCenter, 50, 50);detector.addShape(spaceShip); Steps: Part 1: Place spaceship in themiddle of the screen. Get help if you need clarification. Randomlyplace a “Point” representing the homebase. The point locationshould be far from the spaceship (i.e.; it cannot be touching thespaceship). Regenerate the point until it
OR
OR