com.croftsoft.apps.dodger
Class DodgerSprite

java.lang.Object
  extended by com.croftsoft.core.animation.sprite.AbstractSprite
      extended by com.croftsoft.core.animation.sprite.IconSprite
          extended by com.croftsoft.apps.dodger.DodgerSprite
All Implemented Interfaces:
ComponentAnimator, ComponentPainter, ComponentUpdater, Sprite, KeyListener, MouseListener, MouseMotionListener, EventListener, MouseInputListener

public class DodgerSprite
extends IconSprite
implements KeyListener, MouseInputListener

An IconSprite subclass representing the Dodger.

Since:
2002-03-18
Version:
2003-07-12
Author:
David Wallace Croft

Field Summary
 
Fields inherited from class com.croftsoft.core.animation.sprite.AbstractSprite
componentPainter, componentUpdater, heading, velocity, x, y, z
 
Constructor Summary
DodgerSprite(Icon greenIcon, Icon yellowIcon, Icon redIcon, Icon bangIcon, Icon boomIcon, AudioClip bangAudioClip, Rectangle bounds)
           
 
Method Summary
 long getScore()
           
 Rectangle2D getShootArea()
           
 boolean isShooting()
           
 void keyPressed(KeyEvent keyEvent)
           
 void keyReleased(KeyEvent keyEvent)
           
 void keyTyped(KeyEvent keyEvent)
           
 void mouseClicked(MouseEvent mouseEvent)
           
 void mouseDragged(MouseEvent mouseEvent)
           
 void mouseEntered(MouseEvent mouseEvent)
           
 void mouseExited(MouseEvent mouseEvent)
           
 void mouseMoved(MouseEvent mouseEvent)
           
 void mousePressed(MouseEvent mouseEvent)
           
 void mouseReleased(MouseEvent mouseEvent)
           
 void resetScore()
           
 void setHit()
           
 void update(JComponent component)
          Updates the state of a JComponent and calls repaint() as required.
 
Methods inherited from class com.croftsoft.core.animation.sprite.IconSprite
getCollisionBounds, getCollisionShape, getIcon, getPaintBounds, paint, setIcon, setX, setY
 
Methods inherited from class com.croftsoft.core.animation.sprite.AbstractSprite
getHeading, getVelocity, getX, getY, getZ, setComponentPainter, setComponentUpdater, setHeading, setVelocity, setZ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DodgerSprite

public DodgerSprite(Icon greenIcon,
                    Icon yellowIcon,
                    Icon redIcon,
                    Icon bangIcon,
                    Icon boomIcon,
                    AudioClip bangAudioClip,
                    Rectangle bounds)
Method Detail

getScore

public long getScore()

isShooting

public boolean isShooting()

getShootArea

public Rectangle2D getShootArea()

resetScore

public void resetScore()

setHit

public void setHit()

update

public void update(JComponent component)
Description copied from interface: com.croftsoft.core.animation.ComponentUpdater
Updates the state of a JComponent and calls repaint() as required.

Specified by:
update in interface ComponentUpdater
Overrides:
update in class AbstractSprite

mouseClicked

public void mouseClicked(MouseEvent mouseEvent)
Specified by:
mouseClicked in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent mouseEvent)
Specified by:
mouseDragged in interface MouseMotionListener

mouseEntered

public void mouseEntered(MouseEvent mouseEvent)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent mouseEvent)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent mouseEvent)
Specified by:
mouseMoved in interface MouseMotionListener

mousePressed

public void mousePressed(MouseEvent mouseEvent)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent mouseEvent)
Specified by:
mouseReleased in interface MouseListener

keyPressed

public void keyPressed(KeyEvent keyEvent)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent keyEvent)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent keyEvent)
Specified by:
keyTyped in interface KeyListener

CroftSoft Javadoc

CroftSoft Apps Javadoc (2008-09-28 21:15:07)