Package res.guns

Source Code of res.guns.GunMine

/* 
  PlAr is Platform Arena: a 2D multiplayer shooting game
  Copyright (c) 2010, Antonio Ragagnin <spocchio@gmail.com>
    All rights reserved.
   
    This file is licensed under the New BSD License.
*/


package res.guns;

import plar.core.Common;
import plar.core.Gun;

import plar.core.Sprite;
import res.elements.Mine;

import org.jbox2d.collision.AABB;
import org.jbox2d.common.Vec2;

public class GunMine extends Gun {

  public Vec2 damageRange;

  public GunMine() {

    gunName = "Mine Launcher";
    gunUseAmmo = 10;
    damageRange = new Vec2(2.5f, 2.5f);
  }

  public void createBullet() {
    Mine shoot = new Mine();
    Common.info(5, "new mine");
    shoot.actions.removeAction("nogravity");
    shoot.actions.removeAction("collision");

    Vec2 range = damageRange;
    AABB rect = new AABB(new Vec2(-range.x, -range.y), new Vec2(range.x,
        range.y));
    shoot.explosionRelativeRectangle = rect;
    shoot.explosionDamage = 2;
    this.initializeShoot(shoot);
  }

}
TOP

Related Classes of res.guns.GunMine

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.