All Packages Class Hierarchy This Package Previous Next Index
Class ps1.ps1
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----ps1.ps1
- public class ps1
- extends Applet
- implements MouseListener
-
acat
-
-
akatt
-
-
akatt2
-
-
back
-
-
backgrd
- The ps1 class extends Applet and implements MouseListener
This class initializes the applet and acts as the
image observer.
-
chands
-
-
clk
-
-
clock
-
-
numsprites
-
-
pf
-
-
raster
-
-
rcat
-
-
ps1()
-
-
init()
- This method initializes the applet, creates sprites and
adds them to the playfield.
-
mouseClicked(MouseEvent)
- This method handles mouse click events.
-
mouseEntered(MouseEvent)
- This method handles the event when the mouse enters
the side of the applet
-
mouseExited(MouseEvent)
- This method handles the event when the mouse enters
the side of the applet
-
mousePressed(MouseEvent)
- This method handles mouse pressed events.
-
mouseReleased(MouseEvent)
- This method handles the event when the mouse
is released
-
paint(Graphics)
- paints graphics on the applet
-
update(Graphics)
- updates the graphics
backgrd
String backgrd
- The ps1 class extends Applet and implements MouseListener
This class initializes the applet and acts as the
image observer.
6.837 Problem set #1
clk
String clk
raster
Raster raster
acat
AnimatedSprite acat
rcat
AnimatedSprite rcat
akatt
AnimatedSprite akatt
akatt2
AnimatedSprite akatt2
chands
AnimatedSprite chands
clock
Sprite clock
pf
Playfield pf
back
Image back
numsprites
int numsprites
ps1
public ps1()
init
public void init()
- This method initializes the applet, creates sprites and
adds them to the playfield.
- Overrides:
- init in class Applet
paint
public void paint(Graphics g)
- paints graphics on the applet
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- updates the graphics
- Overrides:
- update in class Container
mouseClicked
public void mouseClicked(MouseEvent event)
- This method handles mouse click events. If the mouse is clicked
on an existing sprite, it will either move to the next track
for that animated sprite, or restart the current track.
If the mouse is not clicked on an existing sprite, then
a running cat is created at the location where the mouse
was clicked.
mousePressed
public void mousePressed(MouseEvent event)
- This method handles mouse pressed events.
mouseEntered
public void mouseEntered(MouseEvent event)
- This method handles the event when the mouse enters
the side of the applet
mouseExited
public void mouseExited(MouseEvent event)
- This method handles the event when the mouse enters
the side of the applet
mouseReleased
public void mouseReleased(MouseEvent event)
- This method handles the event when the mouse
is released
All Packages Class Hierarchy This Package Previous Next Index