diff --git a/src/ei/engine/_desktop.ini b/src/ei/engine/_desktop.ini new file mode 100644 index 0000000..f9413bf --- /dev/null +++ b/src/ei/engine/_desktop.ini @@ -0,0 +1 @@ +2007/4/17 \ No newline at end of file diff --git a/src/ei/game/scene/units/APU.java b/src/ei/game/scene/units/APU.java new file mode 100644 index 0000000..35d94f7 --- /dev/null +++ b/src/ei/game/scene/units/APU.java @@ -0,0 +1,66 @@ +package ei.game.scene.units; + +import ei.engine.math.Vector2f; +import ei.engine.math.Vector2i; +import ei.engine.scene.Sprite; +import ei.game.player.Player; +import ei.game.scene.SelectBox; +import ei.game.scene.weapons.MachineGun; +import ei.game.scene.weapons.Weapon; + +public class APU extends Unit{ + private SelectBox selectionBox; + private Sprite sprite; + public APU(Player p) { + this(0, 0, p); + } + + public APU(int x, int y, Player p){ + super(100, new Vector2i(x,y), p); + this.sprite = new Sprite("Tank", "data/units/apu/apu0000.png"); + sprite.setSize(new Vector2f(40,40)); + getNode().add(sprite); + + selectionBox = new SelectBox(40,40,getMaxLife()); + setLife(50); + } + + protected SelectBox getSelection() { + return selectionBox; + } + /** + * Returns the weapon connected to this type + * of unit. + */ + public Weapon getWeapon(Vector2f startPos) { + return new MachineGun(startPos); + } + /** + * This unit type is now destroyed. + */ + public void destroyed(){ + + } + /** + * returns the velocity of the unit type. + * @return + */ + public float getVelocity() { + return 2; + } + /** + * Manages the sprite connected to this unit. + * @param s + */ + public void setSprite(Sprite s) { + this.sprite = s; + } + /** + * returns the sprite connected to this type + * of unit. + * @return + */ + public Sprite getSprite() { + return this.sprite; + } +} diff --git a/src/ei/game/scene/weapons/MachineGun.java b/src/ei/game/scene/weapons/MachineGun.java new file mode 100644 index 0000000..52c78ea --- /dev/null +++ b/src/ei/game/scene/weapons/MachineGun.java @@ -0,0 +1,26 @@ +package ei.game.scene.weapons; + +import ei.engine.effects.Particles; +import ei.engine.math.Vector2f; + +public class MachineGun extends Weapon{ + + public MachineGun(Vector2f startPos) { + super(startPos); + setVelocity(4); + setRange(500); + setDamage(2); + setReload(10); + } + public Particles getWeapon() { + Particles part = new Particles("cannon"); + part = new Particles("weapon"); + part.MaxSpeedX=500; + part.MaxSpeedY=400; + part.MaxSpeedZ=600; + part.rainbow = false; + part.size=1; + return part; + } + +}