Question: in java please Alternative Collision Shapes In the Basic Adaptable Game Engine Library, we are assuming that each Sprite has a rectangular- shaped boundary. Alternatively,

in java please in java please Alternative Collision Shapes In the Basic Adaptable Game Engine

Alternative Collision Shapes In the Basic Adaptable Game Engine Library, we are assuming that each Sprite has a rectangular- shaped boundary. Alternatively, we could have assumed that each Sprite has a circular shaped boundary. For this assignment, create a class named Circle that contains fields representing a center point (doubles variables center and centerY) and the radius (a double variable radius). Similar to the Rectangle class, create a setValues method that sets all values, a setCenter method that only sets the center coordinates, a setRadius method that only sets the radius, and an overlaps method that checks if this circle overlaps another circle. (Two circles overlap when the distance between the center points of the two circles is less than the sum of the radii of the circles; you may need to look up a formula to calculate the distance between two point to use in this function.) In addition, create a class named TestCircle (similar to TestRectangle) that creates three circle objects C1, C2, and C3; choose parameters for the circles so that C1 overlaps C2 and C2 overlaps C3, but Ci does not overlap C3. In the test class, print the results of testing the overlaps between each pair of circles. Once you have finished your project, estimate your score using the following grading rubric (partial credit encouraged); submit this along with the two java source code files for this assignment. If you assign partial credit for any part of this assignment, explain why. /15 - Circle class contains required fields, default constructor, parameterized constructor /20 - Circle class contains setValues, setCenter, setRadius methods /20 - Circle class contains overlaps method that works as described /20 - TestCircle class contains three Circle objects that overlap each other as described /15 - All source code is commented / 10 - Project score estimate completed, accurate, and included with submission

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!