Ejemplo n.º 1
0
  public Player(Point2D p) {
    super(p);
    direction = new Vector2D(0, -1);
    rotation = Rotation.NONE;

    double rotationSpeed = 0.17;
    sin = Math.sin(rotationSpeed);
    cos = Math.cos(rotationSpeed);

    boostingImage = ImageManager.getImage("boosting.png").getImage();
    ImageIcon icon = ImageManager.getImage("player.png");
    rectangle = new Rectangle(icon.getIconWidth(), icon.getIconHeight());
    rectangle.setLocation(p.getPoint());
    image = icon.getImage();

    shields = 255;
    weaponIndex = 0;
    weapons = new ArrayList<Weapon>();
    weapons.add(new SMP9(this));
    weapons.add(new X2Vulcan(this));
    weapons.add(new EM12Carbine(this));
    weapons.add(new Stinger2(this));
    weapons.add(new ALS22(this));
    weapons.add(new Solaris(this));

    weapon = weapons.get(weaponIndex);

    autoPilot = new AutoPilot(this);
  }