What a Nice Day!

What a Nice Day!

Project 4

What a Nice Day!

Problem

This project can be deemed as Mercman 2.0. It is a great opportunity for you to put together a fun animation project by using all the OO programming concepts that we discussed in class so far: interface, abstract/concrete classes, as well as GUI programming.

In this assignment, you need to design your own house, driveway, school bus, as well as schoolchild, traffic lights, and other game objects as appropriate. You also need to addbuttons on the control panel to the left, to trigger start and stop of the bus, on/off of traffic lights, and child boarding the bus.

AnalysisDesign

As discussed in class, the following Java constructsare used to categorize various kinds of game objects.

-Drawableand Moveable interfaces: specify the protocols for drawing and moving objects to be displayed in a game scene;

-SceneEntity abstract class: implements the Drawableinterface, and provides a default way to draw outline of a list of Shape objects this class tracks;

-Sprite abstract class: extends SceneEntity and implements the Moveableinterface to provide a way to translate all shapes associated with the sprite;

-Specific (concrete) classes, such as those for house and school bus: extend the appropriate base class for stationary or moveable game objects, and override the draw() method so as to render the “images” correctly;

-GameViewPanel class: defines (stationary or moveable) game objects involved and the way they are displayed (by overriding the paintComponent() method);

-GameMain class: holds the game view and control panels and hosts the controllers, which may be defined as separate classes.

The codebase as provided serves as a framework that you can use in other projects that need to draw and move shapes.

Use your imagination and check Java online API to see how to make it happening with basic shapesand curves. A simple demo program is provided to show how to define and fill a GeneralPath to make arbitrary shapes. You need to use instance variables for major parameters (x, y, r, color, etc.) such that you can create multiple instances with different visual features.

Coding and Commenting

Use meaningful identifiers for your classes and variables. Format your code consistently. Use Javadoc style comments (Horstmann, p90) for your classes and methods. Don’t try to add too much commenting. Follow the examples in your text and use the IDE may help you meet this requirement more easily.

Testing

A minimum set of requirements include:

-At least two moveable entities (bus and schoolchild)and two stationary entities (house and traffic lights) need to be in display;

-Schoolchild needs to walk to and disappear inside the bus; and

-Each change is triggered by a button (such as start/stop a bus, change the traffic lights, move the schoolchild, etc.)

You are encouraged to automate the events as far as you can. You may change the theme into something at the same difficulty level or even more challenging. Some students from last year tried to pick up astronaut with a rocket in outer space. Images may be used instead of primitive shapes that are draw with Java classes.

Deliverables and Due Date

You need to submit your Project 4 Report (in Word or PDF format) in class by Friday March 16, 2018. The report should include source code for all your concrete classes as well as screenshots highlighting the game scenes.

Also, please save the following in a project folder in your Z: drive (or Google Drive) account:

-Source code with javadoc style comments with an appropriate folder structure;

-Project 4 Report.