import java.awt.*;

public class Velo extends Mobile {
  protected static int speed_max = 20;   //nouvel attribut (en m/s)
  protected Color color;
  static final Color color_default = Color.red;

  Velo() {
    super();
    color=color_default;
  }
    
  Velo(String nom) {
    super(nom);
    color=color_default;
  }
    
  Velo(Point P) {
    super(P);
    color=color_default;
  }

  Velo(Color color) {
    super();
    this.color=color;
  }

  Velo(Point P,Color color) {
    this(color);
    this.x =P.x;
    this.y =P.y;
  }

  Velo(String nom,Point P,Color color) {
    this(P,color);
    this.nom =new String(nom);
  }

  public Color getColor() {
    return color;
  }
  
  public void setColor(Color c) {
    this.color = c;
  }
  
  public boolean move() {            //redefinition
    double v;
    boolean boum=false;
    /*	Private Boolean boum=FALSE;*/
    x += vX ;
    y += vY ;
    vX += gX ;
    vY += gY ;
    v= Math.sqrt(vX*vX + vY*vY);
    if (v>speed_max) 
      {
	boum=true;
	vX=0;
	vY=0;
      }
    return boum; //se casse la figure...
  }
    
  public String toString() {
    return "[Velo "+ super.toString() + "]";
  }
    
  
  public static void main(String[] args) {
    Velo v0 = new Velo("toto");
    v0.setG(4,8);
    for(int i = 0 ; i < 40 ; i++) 
      {
	if(v0.move()) System.out.print("BOUM!!!"); 
	System.out.println(v0);
      }
  }  
}