appletbots.balls
Class Ball
java.lang.Object
appletbots.WorldObject
appletbots.balls.Ball
public class Ball
- extends WorldObject
The class represents a ball in the appletbots world
- Author:
- Erik Rasmussen
Constructor Summary |
Ball(int size,
java.awt.Color color)
Constructs a ball with the given size (radius) and color. |
Ball(int size,
double mass,
java.awt.Color color)
Constructs a ball with the given size (radius), mass, and color. |
Ball(int size,
double maxSpeed,
double mass,
java.awt.Color color)
Constructs a ball with the given size (radius), maxSpeed, mass, and
color. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Ball
public Ball(int size,
java.awt.Color color)
- Constructs a ball with the given size (radius) and color. The ball's
mass is set to the same as the ball's size, and the maxSpeed is set to
twice the size (the diameter).
- Parameters:
size
- The radius of the ballcolor
- The color of the ball
Ball
public Ball(int size,
double mass,
java.awt.Color color)
- Constructs a ball with the given size (radius), mass, and color. The
ball's maxSpeed is set to twice the size (the diameter).
- Parameters:
size
- The radius of the ballmass
- The mass of the ballcolor
- The color of the ball
Ball
public Ball(int size,
double maxSpeed,
double mass,
java.awt.Color color)
- Constructs a ball with the given size (radius), maxSpeed, mass, and
color.
- Parameters:
size
- The radius of the ballmaxSpeed
- The maximum speed of the ballmass
- The mass of the ballcolor
- The color of the ball