com.croftsoft.apps.shooter
Class ShooterSprite

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

public class ShooterSprite
extends AbstractSprite
implements MouseInputListener

An IconSprite subclass representing the Attacker.

Since:
2002-03-23
Version:
2003-07-11
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
ShooterSprite(Image restImage, Image bangImage, Image boomImage, AudioClip bangAudioClip, Shooter shooter)
           
 
Method Summary
 Shape getCollisionShape()
           
 void getPaintBounds(Rectangle paintBounds)
           
 long getScore()
           
 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 paint(JComponent component, Graphics2D graphics)
           
 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.AbstractSprite
getCollisionBounds, getHeading, getVelocity, getX, getY, getZ, setComponentPainter, setComponentUpdater, setHeading, setVelocity, setX, setY, setZ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShooterSprite

public ShooterSprite(Image restImage,
                     Image bangImage,
                     Image boomImage,
                     AudioClip bangAudioClip,
                     Shooter shooter)
Method Detail

getScore

public long getScore()

getCollisionShape

public Shape getCollisionShape()
Specified by:
getCollisionShape in interface Sprite

getPaintBounds

public void getPaintBounds(Rectangle paintBounds)
Specified by:
getPaintBounds in interface Sprite

setHit

public void setHit()

resetScore

public void resetScore()

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

paint

public void paint(JComponent component,
                  Graphics2D graphics)
Specified by:
paint in interface ComponentPainter
Overrides:
paint 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

CroftSoft Javadoc

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