initial commit
[applet-bots.git] / src / appletbots / balls / Ball.java
blobe5b2fff382678ecb57b0cab3e591833d21168e9a
1 /*
2 * Copyright (c) 2002 Erik Rasmussen - All Rights Reserverd
3 */
4 package appletbots.balls;
6 import appletbots.WorldObject;
8 import java.awt.*;
10 /**
11 * The class represents a ball in the appletbots world
13 * @author Erik Rasmussen
15 public class Ball extends WorldObject
17 /**
18 * Constructs a ball with the given size (radius) and color. The ball's
19 * mass is set to the same as the ball's size, and the maxSpeed is set to
20 * twice the size (the diameter).
22 * @param size The radius of the ball
23 * @param color The color of the ball
25 public Ball(final int size, final Color color)
27 this(size, (double) size, color);
30 /**
31 * Constructs a ball with the given size (radius), mass, and color. The
32 * ball's maxSpeed is set to twice the size (the diameter).
34 * @param size The radius of the ball
35 * @param mass The mass of the ball
36 * @param color The color of the ball
38 public Ball(final int size, final double mass, final Color color)
40 this(size, size / 2.0, mass, color);
43 /**
44 * Constructs a ball with the given size (radius), maxSpeed, mass, and
45 * color.
47 * @param size The radius of the ball
48 * @param maxSpeed The maximum speed of the ball
49 * @param mass The mass of the ball
50 * @param color The color of the ball
52 public Ball(final int size, final double maxSpeed, final double mass, final Color color)
54 super(mass, maxSpeed, size, color);