Create a movie of a turtle (turtle.jpg) crawling across the beach (beach.jpg).

What will be an ideal response?

```
/**
* Method to c r e a t e a movie where a t u r t l e c rawl s
* ac ros s the beach
* @param d i r e c t o r y the d i r e c t o r y to s t o r e the frames in
*/
public void makeTurtleMovie ( St r ing d i r e c t o r y )
{
// g e t the p i c t u r e s to use
Pi c tur e p i c t 1 = new Pi c tur e ( Fi l eChoos e r . getMediaPath ( "beach . jpg " ) ) ;
Pi c tur e p i c t 2 = new Pi c tur e ( Fi l eChoos e r . getMediaPath ( " t u r t l e . jpg " ) ) ;
Pi c tur e copyPict = nul l ;
// d e c l a r e o the r v a r i a b l e s
FrameSequencer f rameSequencer =
new FrameSequencer ( d i r e c t o r y ) ;
int f ramesPerSec = 3 0 ;
// loop c r e a t i n g the frames
for ( int i = 0 ; i < f ramesPerSec ; i++)
{
copyPict = new Pi c tur e ( p i c t 1 ) ;
copyPict . copy ( pi c t2 , i + 7 , 3 0 0 ) ;
f rameSequencer . addFrame ( copyPict ) ;
}
// p lay the movie
f rameSequencer . play ( f ramesPerSec ) ;
```

Computer Science & Information Technology

You might also like to view...

When you change a value in a cell, Excel automatically recalculates

Indicate whether the statement is true or false

Computer Science & Information Technology

The ________ control in Visual Basic is used to display a button to execute some action when the user clicks it

Fill in the blank(s) with correct word

Computer Science & Information Technology