game.graphics
Class CBouncingBall
java.lang.Object
game.physics.CStaticShape
game.physics.CDynamicShape
game.physics.CColoredDynamicShape
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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_r
final float m_r
CBouncingBall
public CBouncingBall(IGameDisplay gameRect,
CVector2D origin,
CVector2D speed,
float radius,
java.awt.Color color)
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