com.croftsoft.apps.shooter
Class AttackerSprite

java.lang.Object
  extended by com.croftsoft.core.animation.sprite.AbstractSprite
      extended by com.croftsoft.apps.shooter.AttackerSprite
All Implemented Interfaces:
ComponentAnimator, ComponentPainter, ComponentUpdater, Sprite

public class AttackerSprite
extends AbstractSprite

An IconSprite subclass representing a Shooter 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
AttackerSprite(AudioClip explodeAudioClip, Random random, double averageVelocity)
           
 
Method Summary
 Shape getCollisionShape()
           
 void getPaintBounds(Rectangle paintBounds)
           
 boolean intersectsLine(double x1, double y1, double x2, double y2)
           
 boolean isHit()
           
 void paint(JComponent component, Graphics2D graphics)
           
 void reset()
           
 void setHit()
           
 void setX(double x)
           
 void setY(double y)
           
 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, setZ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttackerSprite

public AttackerSprite(AudioClip explodeAudioClip,
                      Random random,
                      double averageVelocity)
Method Detail

getPaintBounds

public void getPaintBounds(Rectangle paintBounds)

getCollisionShape

public Shape getCollisionShape()

intersectsLine

public boolean intersectsLine(double x1,
                              double y1,
                              double x2,
                              double y2)

isHit

public boolean isHit()

setX

public void setX(double x)
Specified by:
setX in interface Sprite
Overrides:
setX in class AbstractSprite

setY

public void setY(double y)
Specified by:
setY in interface Sprite
Overrides:
setY in class AbstractSprite

setHit

public void setHit()

reset

public void reset()

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

CroftSoft Javadoc

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