Write a simple (at first!) Halloween-themed drawing.
(A
Pumpkin , or a
Bat , or a
SpookyCastle , or ...)
This can be built on top of something you did for a previous lab but should include all of the following...
-
Have some part(s) of your drawing show up only after the user says... ok.
Consider...
- You class *must* have an ARRAY as a necessary member of your applications. Can't be used JUST for x & y of some polygon.
(Could be all values neccessary for all arc's on the Pumpkin, the lines on the Bat wings, the bricks? on a SpookyCastle, ...)
- Make an array's worth of shapes of diffent colors.
Pass the array as a parameter to another method that will draw a row (or column?) of the shapes using each color in turn.
Shuffle the color array.
Pass the array as a parameter to that same method that will draw a row (or column?) of the shapes using each color in turn.
Be sure to adjust the location before the next row (or column?) is drawn. Could be another parameter *OR* a static class
variable.
-
Your class should have SEVERAL separate methods all/most with necessary customizing parameters.
Some of these should return void, some something else -- at least one should return an array.
Maybe a method is given an array to use when building and customizing the size & location.
Call that method several times to demonstrate the parameter passing (actual parameter to formal parameter list) is working.
-
At least one of the methods in your class should be OVERLOADED.
The design of your application and how to control it should be very clear to
a user.
Be bold!
Be daring!
Have fun!
Halloween theme NOT req'd but all of the 'requirements' above are.
- Not a spooky castle but .. a high rise bldg with number of windows
dependent on height and some with lights on and some lights out.
- Not a row of pumpkins but... a road of different colored & sized cars
- You get the idea...
Stumped for ideas?
- One method will populate an array with randomly generate a bunch of shapes; storing values for each in the array.
20 randomly colored transparent ovals meant to be balloons
Next pass the array to another method which will average all the x's & y's and draw a line from the average x,y location
to the center of each of the objects.
lines from "center" of all the balloons radiating out to their centers.
Overload so that instead of calculating and using the average location, the user
can instead pass an x & y along with the array.
lines can all originate from the hand of ... your ghost(?) to each of the balloons. Not quite right because we'd really
like the lines to go to the 'bottom' of each balloon to let it ... bob about but close enough for now!
- go back and see book for how to implement simple animations. (Section 1.5.3 on p.153)
(Pumpkin(s) bouncing around the castle ?!? Bats flying around belfry?)
Here's a VERY SIMPLE example... using numbers again. CountingClient.java
raining ... no need to clear if you just keep adding as rain dribbles down; random locations; random speeds
(like "The Matrix" code... how can you get colors to...fade & change without changing the characters drawn?)
flowers growing up?
fish swimming left/right?
- what else?