game.physics
Class CDynamicShape
java.lang.Object
game.physics.CStaticShape
game.physics.CDynamicShape
- Direct Known Subclasses:
- CAnimatedSprite, CColoredDynamicShape, CMovingText
public abstract class CDynamicShape
- extends CStaticShape
Extends CStatic shape by adding movement. It has a velocity, it can bounce, wrap, and be subjected to gravity.
- Author:
- sroccaserra
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
G
public static final float G
- See Also:
- Constant Field Values
m_v
protected CVector2D m_v
m_bApplyGravity
protected boolean m_bApplyGravity
m_bBouceOnGameRect
protected boolean m_bBouceOnGameRect
CDynamicShape
public CDynamicShape(IGameDisplay gameRect,
CBoundingBox boundingBox,
CVector2D velocity)
getVelocity
public final CVector2D getVelocity()
- Description copied from class:
CStaticShape
- Returns a null vector (static shapes don't move).
- Overrides:
getVelocity
in class CStaticShape
- Returns:
- a null vector.
cycle
public void cycle()
- Description copied from class:
CStaticShape
- Does nothing. Override at will.
- Overrides:
cycle
in class CStaticShape
animate
public void animate(float dt)
- Description copied from class:
CStaticShape
- Does nothing (static shapes don't move).
- Overrides:
animate
in class CStaticShape
applyGravity
private final void applyGravity(float dt)
bounceOnGameRect
protected void bounceOnGameRect()
wrapAtGameLimits
final void wrapAtGameLimits()