/*     */   public Projectiles(int x, int y, int aimX, int aimY, int bulletSpeed, int damage, Unit owner)
/*     */   {
/*  19 */     this.x = x;
/*  20 */     this.y = y;
/*  21 */     this.bulletSpeed = bulletSpeed;
/*  22 */     this.aimX = aimX;
/*  23 */     this.aimY = aimY;
/*  24 */     this.damage = damage;
/*  25 */     this.owner = owner;
/*  26 */     this.alive = true;
/*  27 */     this.r = new Rectangle(x, y, 3, 3);
/*     */ 
/*  30 */     float diffX = Math.abs(aimX - x);
/*  31 */     float diffY = Math.abs(aimY - y);
/*  32 */     float totalXY = diffX + diffY;
/*     */ 
/*  34 */     if (diffX >= diffY) {
/*  35 */       this.xPercent = (diffX / totalXY);
/*  36 */       this.yPercent = (1.0F - this.xPercent);
/*     */     } else {
/*  38 */       this.yPercent = (diffY / totalXY);
/*  39 */       this.xPercent = (1.0F - this.yPercent);
/*     */     }
/*  41 */     this.speedX = (this.xPercent * bulletSpeed);
/*  42 */     this.speedY = (this.yPercent * bulletSpeed);
/*     */ 
/*  45 */     if ((x < aimX) && (y > aimY)) {
/*  46 */       this.speedY *= -1.0F;
/*     */     }
/*  48 */     if ((x > aimX) && (y < aimY)) {
/*  49 */       this.speedX *= -1.0F;
/*     */     }
/*  51 */     if ((x > aimX) && (y > aimY)) {
/*  52 */       this.speedX *= -1.0F;
/*  53 */       this.speedY *= -1.0F;
/*     */     }
/*     */ 
/*  56 */     Core.effects.add(new MuzzleFlash(120, x, y));
/*     */   }