Create a movie with a filled oval moving up diagonally from the bottom left to the top right of the picture.
What will be an ideal response?
```
/? ?
? Method t o make a movie t h a t has a o v a l moving
? from bottom l e f t t o t o p r i g h t
? @param d i r e c t o r y t h e d i r e c t o r y t o p u t t h e movie
? frames
?/
public void makeOvalMovie ( S t r i n g d i r e c t o r y )
{
int framesPerSec = 3 0 ;
P i c t u r e p = null ;
G r a p h i c s g = null ;
FrameSequencer f r a m e S e q u e n c e r =
new FrameSequencer ( d i r e c t o r y ) ;
f r a m e S e q u e n c e r . setShown ( true ) ;
// l o o p t h r o u g h t h e f i r s t s e c o n d
f o r ( i n t i = 0 ; i < f r a m e s P e r S e c ; i ++)
{
// draw a f i l l e d o v a l
p = new P i c t u r e ( 6 4 0 , 4 8 0 ) ;
g = p . getGraphics ( ) ;
g . s e t C o l o r ( C o l o r .RED) ;
g . f i l l O v a l ( i ? 1 0 , 430 ? ( i ? 1 0 ) , 5 0 , 5 0 ) ;
// add frame t o s e q u e n c e r
f r a m e S e q u e n c e r . addFrame ( p ) ;
}
// p l a y t h e movie
frameSequencer . play ( framesPerSec ) ;
}
```
You might also like to view...
The ________ function coverts text to title case
Indicate whether the statement is true or false.
A class with no abstract methods is called a
(a) concrete class (b) encapsulated class (c) abstract class (d) private class