The post lab 4 assignment involves creating a very simple game
where the player has control over a character. The sprite class
from assignment 1 has methods for testing for intersection, but it
doesn't have methods for preventing intersection, which are needed
in the simple game. The
file Sprite.java contains the sprite
class from the first assignment. The deintersect(Sprite
otherSprite)
method needs to be defined. The method should
move the x or y coordinate of this sprite the smallest amount
necessary so that this sprite is no longer intersecting with the
specified other sprite. The method should use the various overlap
methods to determine how to change the x or y coordinates. If the
two sprites are not intersecting the method should not change the
sprite's coordinates.
Submission: Submit your code as a zip file with your name as the zip file name on the course Inquire site.