appletbots.balls
Class Ball

java.lang.Object
  extended by appletbots.WorldObject
      extended by appletbots.balls.Ball

public class Ball
extends WorldObject

The class represents a ball in the appletbots world

Author:
Erik Rasmussen

Field Summary
 
Fields inherited from class appletbots.WorldObject
color, mass, maxSpeed, size
 
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.
 
Method Summary
 
Methods inherited from class appletbots.WorldObject
collidedWith, getColor, getMass, getMaxSpeed, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 ball
color - 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 ball
mass - The mass of the ball
color - 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 ball
maxSpeed - The maximum speed of the ball
mass - The mass of the ball
color - The color of the ball