game.graphics
Class CBouncingBall

java.lang.Object
  extended by game.physics.CStaticShape
      extended by game.physics.CDynamicShape
          extended by game.physics.CColoredDynamicShape
              extended by game.graphics.CBouncingBall
All Implemented Interfaces:
ICriticalObject, IGraphicObject

public class CBouncingBall
extends CColoredDynamicShape
implements ICriticalObject

A colored disc bouncing on the game's display area's limits.

Author:
sroccaserra

Field Summary
(package private)  float m_r
           
 
Fields inherited from class game.physics.CColoredDynamicShape
m_color
 
Fields inherited from class game.physics.CDynamicShape
G, m_bApplyGravity, m_bBouceOnGameRect, m_v
 
Fields inherited from class game.physics.CStaticShape
m_box, m_gameDisplay, m_isHidden
 
Fields inherited from interface game.graphics.ICriticalObject
CRITICAL_VALUE
 
Constructor Summary
CBouncingBall(IGameDisplay gameRect, CVector2D origin, CVector2D speed, float radius, java.awt.Color color)
           
 
Method Summary
 void draw(java.awt.Graphics g)
           
 boolean intersect(float x, float y)
          Checks for intersection with a 2D point.
 boolean isCritical()
           
 
Methods inherited from class game.physics.CDynamicShape
animate, bounceOnGameRect, cycle, getVelocity
 
Methods inherited from class game.physics.CStaticShape
drawBox, getCenter, hide, isHidden, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface game.graphics.IGraphicObject
animate, cycle, getCenter, getVelocity
 

Field Detail

m_r

final float m_r
Constructor Detail

CBouncingBall

public CBouncingBall(IGameDisplay gameRect,
                     CVector2D origin,
                     CVector2D speed,
                     float radius,
                     java.awt.Color color)
Method Detail

draw

public void draw(java.awt.Graphics g)
Specified by:
draw in interface IGraphicObject

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.

isCritical

public boolean isCritical()
Specified by:
isCritical in interface ICriticalObject