The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Where to Start??

Posted by PADFOR on March 05, 2001 at 4:23 PM

I am working through a java book, and I am stuck on this problem. Could
someone give me some pointers?

The Task

Your task is to write a Java application which allows us to animate several simple shapes within a defined area of the application (perhaps a Panel). Shapes should "bounce" off the boundary of
this area. The application should be multithreaded, where appropriate. You may impose an upper limit on the number of shapes if you wish, but should allow at least up to 10 shapes.

Requirements

Your application should:

1.Allow the user to add simple shapes (circles and squares) into the animation area.
2.The user should be allowed to specify:
a.which shape to add,
b.the size of the shape,
c.which colour to fill the shape with,
d.the initial trajectory (dx and dy) values.
3.Shapes should not collide with each other but should pass "through" or "over" each other.
4.Allow the user to stop/start one of the shapes moving by clicking it. The motion of all the other shapes should be unaffected by this.
5.Whilst a shape is stopped the user should be able to change the size, shape, colour and trajectory of the shape (e.g. via a dialog box which pops up when the shape is clicked). You should
not allow the attributes of a shape to be changed whilst it is in motion.
6.Allow the user to stop/start all of the shapes by clicking in the background of the animation area.
7.Use off screen images and clipping areas to make the animation smooth



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us