/*
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);
}
}
}