Assignment 4

Due: May 28 Email to both Akash and Kav

You are to create a game or simulation that uses a visualization of moving objects that exhibit different behavior depending on interactions. You are to use the Strategy pattern to dynamically change the behavior. Your game/simulation must have two or more different derived classes and use the Strategy pattern.

Suggestion: A predator/prey game. The player is the predator using the keyboard to chase down prey. There are two or more types of prey. When the predator is not near the prey, the prey move about slowly. When the predator comes within a certain distance of the prey they begin to move more quickly. When very close the prey moves at maximum speed. If you want, you can make the predator also change movement behaviors. To make it simple, you can use simple geometric shapes for the predator and prey, say a circle for predator and square for prey. I would recommend that you not only change the movement behavior of the prey, but also the color of the geometric shapes for each state. Other ideas are allowed as long as the capture the same spirit as the example above and use the strategy pattern.