CSE115.ShapeWorld.BouncyShapes
Class Lab4BouncingTriangle
java.lang.Object
NGP.Graphics.Shape
NGP.Graphics.RectangularShape
NGP.Graphics.FilledRectangularShape
CSE115.Graphics.FilledTriangle
CSE115.ShapeWorld.BouncyShapes.Lab4BouncingTriangle
- All Implemented Interfaces:
- MouseListener, MouseMotionListener, EventListener, Colorable, Graphic, Locatable, Reactor, Rotatable, Sizeable
public class Lab4BouncingTriangle
- extends FilledTriangle
A triangle that bounces around on an applet.
- Author:
- Adrienne Decker
| Methods inherited from class NGP.Graphics.Shape |
contains, drag, getBounds, getCenterLocation, getColor, getDrawingPanel, getRotation, hide, intersects, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, react, setColor, setDrawingPanel, setRotation, show |
Lab4BouncingTriangle
public Lab4BouncingTriangle()
- Creates a new
Triangle instance.
setSize
public void setSize(Size size)
- Sets the size of the Triangle
- Parameters:
size - -
the size to make the triangle
setVelocity
public void setVelocity(Velocity velocity)
- Sets the velocity of the triangle
- Parameters:
velocity - -
the speed at which the triangle should move
setRotationSpeed
public void setRotationSpeed(RotationSpeed speed)
- Sets the rate of rotation for the triangle
- Parameters:
speed - -
the speed at which the triangle should rotate