Constructor
new Tank(width, pos, colorVal)
    Constructor for the tank object.  The height is determined by the golden
ratio with respect to the width.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| width | number | the width of the tank | 
| pos | p5.Vector | the position of the tank | 
| colorVal | Array.<3, Number> | the color of the tank | 
Methods
addDamage(damage)
    Adds damage to the tank.  Does not allow for damage outside of the range
0 to 100.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| damage | number | the damage to apply to the tank. | 
attachTo(gameEngine)
    Attach the tank to the game engine and keep a handle for the
game engine.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| gameEngine | TankGame.GameEngine | The game engine. | 
Throws:
- 
        param gameEngine should be instance of TankGame.GameEngine
- Type
- Error
checkOffScreen()
    Check if the tank is off screen.  Explodes the tank if it is below the
bottom of the screen.
        
            
    
    
    decreaseFiringSpeed()
    Decrease the firing speed of the gun.  Does not go below zero.
        
            
    
    
    decreaseGunAngle()
    Decrease the gun angle by 1 degree.  Stops at 0.
        
            
    
    
    draw()
    Draw the entire tank calling the track, gun and body draw functions.
        
            
    
    
    drawBody()
    Draw the body of the tank in the color saved in this.color.
        
            
    
    
    drawGun()
    Draw the gun on the tank at the correct angle
        
            
    
    
    drawHealthBar()
    Draw the health bar above the tank
        
            
    
    
    drawTracks()
    Draw the tracks at the bottom of the tank
        
            
    
    
    explode()
    Explode the tank
        
            
    
    
    getGunAngle() → {number}
    Get the current angle
Returns:
    - The current gun angle in degrees between 0 and 180
- Type
- number
increaseFiringSpeed()
    Increase the firing speed of the gun.  Only goes as high as the health
of the tank.
        
            
    
    
    increaseGunAngle()
    Increase the gun angle by 1 degree.  Stops at 180
        
            
    
    
    isDead() → {Boolean}
    Checks fi the tank is dead.  Only returns true after the tanks is
finished exploding.
Returns:
    - if the tank is dead
- Type
- Boolean
moveLeft()
    Move the tank to the left
        
            
    
    
    moveRight()
    Move the tank to the right
        
            
    
    
    setGunAngle(newAngle)
    Set the gun angle.  If outside of the range 0 and 180 the gun remains at
the same angle.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| newAngle | number | Angle in degrees between 0 and 180 | 
shootProjectile() → {Boolean}
    Shoots the chosen projectile from the tanks gun
Contains a debouncing feature to prevent held down keys from shooting
multiple projectiles
Returns:
    If the projectile was successfully shot
- Type
- Boolean
update(dt)
    Update the tanks position according to the game physics
    Parameters:
| Name | Type | Description | 
|---|---|---|
| dt | number | The time between the current frame and the last one |