game.physics
Class CStaticShape

java.lang.Object
  extended by game.physics.CStaticShape
Direct Known Subclasses:
CDynamicShape, CHighscoreTable, COnscreenMessage, CScoreManager, CStaticSprite

public abstract class CStaticShape
extends java.lang.Object

Base class, has a fixed position and a bounding box. Can be shown or hidden.

Author:
seb

Field Summary
protected  CBoundingBox m_box
           
protected  IGameDisplay m_gameDisplay
           
protected  boolean m_isHidden
           
 
Constructor Summary
CStaticShape(IGameDisplay gameRect)
           
CStaticShape(IGameDisplay gameRect, CBoundingBox boundingBox)
           
 
Method Summary
 void animate(float dt)
          Does nothing (static shapes don't move).
 void cycle()
          Does nothing.
 void drawBox(java.awt.Graphics g)
           
 CVector2D getCenter()
          Returns the center of the shape's bounding box.
 CVector2D getVelocity()
          Returns a null vector (static shapes don't move).
 void hide()
           
 boolean intersect(float x, float y)
          Checks for intersection with a 2D point.
 boolean isHidden()
           
 void show()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_gameDisplay

protected IGameDisplay m_gameDisplay

m_box

protected CBoundingBox m_box

m_isHidden

protected boolean m_isHidden
Constructor Detail

CStaticShape

public CStaticShape(IGameDisplay gameRect)

CStaticShape

public CStaticShape(IGameDisplay gameRect,
                    CBoundingBox boundingBox)
Method Detail

isHidden

public final boolean isHidden()

getVelocity

public CVector2D getVelocity()
Returns a null vector (static shapes don't move).

Returns:
a null vector.

animate

public void animate(float dt)
Does nothing (static shapes don't move).

Parameters:
dt -

cycle

public void cycle()
Does nothing. Override at will.


intersect

public boolean intersect(float x,
                         float y)
Checks for intersection with a 2D point.

Parameters:
x -
y -
Returns:
true if the point is within the shape's bounding box.

getCenter

public CVector2D getCenter()
Returns the center of the shape's bounding box.

Returns:
the center.

hide

public final void hide()

show

public final void show()

drawBox

public void drawBox(java.awt.Graphics g)