game.graphics
Class CSparkle
java.lang.Object
game.physics.CStaticShape
game.physics.CDynamicShape
game.physics.CColoredDynamicShape
game.graphics.CSparkle
- All Implemented Interfaces:
- IEphemereObject, IGraphicObject
public class CSparkle
- extends CColoredDynamicShape
- implements IEphemereObject
Like all IEphemereObjects, CSparkles have a limited lifetime.
Some bounce on the limits, some fly away, some are affected by gravity, others are not.
- Author:
- sroccaserra
Method Summary |
void |
animate(float dt)
Does nothing (static shapes don't move). |
void |
cycle()
Does nothing. |
void |
draw(java.awt.Graphics g)
|
boolean |
intersect(float x,
float y)
Checks for intersection with a 2D point. |
boolean |
isDead()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIZE
private static final int SIZE
- See Also:
- Constant Field Values
ALT_SIZE
private static final int ALT_SIZE
- See Also:
- Constant Field Values
RANDOM_VELOCITY
private static final float RANDOM_VELOCITY
- See Also:
- Constant Field Values
m_isVertical
private final boolean m_isVertical
m_offset
private final float m_offset
m_lifetime
private float m_lifetime
m_variableSize
private int m_variableSize
CSparkle
public CSparkle(IGameDisplay gameRect,
CVector2D position,
CVector2D velocity,
float lifetime)
animate
public void animate(float dt)
- Description copied from class:
CStaticShape
- Does nothing (static shapes don't move).
- Specified by:
animate
in interface IGraphicObject
- Overrides:
animate
in class CDynamicShape
cycle
public void cycle()
- Description copied from class:
CStaticShape
- Does nothing. Override at will.
- Specified by:
cycle
in interface IGraphicObject
- Overrides:
cycle
in class CDynamicShape
draw
public void draw(java.awt.Graphics g)
- Specified by:
draw
in interface IGraphicObject
isDead
public final boolean isDead()
- Specified by:
isDead
in interface IEphemereObject
intersect
public final boolean intersect(float x,
float y)
- Description copied from class:
CStaticShape
- Checks for intersection with a 2D point.
- Specified by:
intersect
in interface IGraphicObject
- Overrides:
intersect
in class CStaticShape
- Returns:
- true if the point is within the shape's bounding box.