A sprite that represents a gun. The gun can shoot Bullet sprites. The gun is
shown as a blue ball with a gun barrel sticking out of it. The barrel points
in the direction that bullets will be shot. The position of the SimpleGun specifies
the center point of the blue ball.
This method is called by the SpritePanel to tell the sprite to draw itself.
It is not meant to be called directly. Subclasses should override this method
to draw an appropriate picture. The method in this class just draws a tiny
black dot at the location of the sprite.
Fire a bullet by adding a Bullet sprite to the panel that contains this GunSprite.
The bullet's speed is given by the gun's bulletSpeed property. The direction of
the bullet is given by the direction the gun is pointing. (If the gun is not in
a SpritePanel, this method does nothing.)
public double getAngle()
public double getBulletSpeed()
public void setAngle(double degrees)
Sets the direction that the gun is pointing. The angle is given in degrees,
with zero degrees pointing up. Positive angles are measured clockwise from
that position; negative angles, counterclockwise.