Package res.elements

Source Code of res.elements.Ammo

/*
  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.elements;



import plar.core.Common;
import plar.core.Element;
import plar.core.Common.ElementType;
import plar.core.ElementGadget;
import plar.core.ElementPlayer;


public class Ammo extends ElementGadget {

    public int ammoGap;

    public  Ammo() {
        super();

        ammoGap=10;
        setStaticSprite("res/gun.png");
        this.setBoxShape(0.3f,0.3f);



    }

    public void elementCollided(Element e) {
        if(e.type==Common.ElementType.PLAYER) {

            ElementPlayer p = ((ElementPlayer)e);
            p.gl.get(p.currentGunIndex).addAmmo(ammoGap);
        }

    }

}
TOP

Related Classes of res.elements.Ammo

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.