Added ai player and fixed so player kan create units
This commit is contained in:
parent
e7403858f8
commit
c83605d5c4
22 changed files with 373 additions and 123 deletions
|
|
@ -21,23 +21,27 @@ public class APU extends Unit{
|
|||
private Sprite sprite;
|
||||
|
||||
private Sound gunSound;
|
||||
private Sound moveSound[] = new Sound[2];
|
||||
private Sound[] moveSound;
|
||||
private Sound attackSound;
|
||||
private Sound selectSound;
|
||||
|
||||
public APU(Player p) {
|
||||
this(0, 0, p);
|
||||
super(70, p);
|
||||
}
|
||||
|
||||
public APU(int x, int y, Player p){
|
||||
super(70, new Vector2i(x,y), p);
|
||||
this.sprite = new Sprite("APU", "data/units/apu/apu0000.png");
|
||||
}
|
||||
|
||||
public void init(){
|
||||
sprite = new Sprite("APU", "data/units/apu/apu0000.png");
|
||||
sprite.setSize(new Vector2f(40,40));
|
||||
getNode().add(sprite);
|
||||
setBuildTime(20);
|
||||
setBuildTime(200);
|
||||
setPrice(200);
|
||||
|
||||
gunSound = new Sound("gunSound", "data/sounds/machinegun.wav");
|
||||
moveSound = new Sound[2];
|
||||
moveSound[0] = new Sound("moveSound", "data/sounds/APUmove1.wav");
|
||||
moveSound[1] = new Sound("moveSound", "data/sounds/APUmove2.wav");
|
||||
selectSound = new Sound("selectSound", "data/sounds/APUselect.wav");
|
||||
|
|
@ -49,7 +53,7 @@ public class APU extends Unit{
|
|||
selectSound.setLocation(getNode().getLocation());
|
||||
attackSound.setLocation(getNode().getLocation());
|
||||
|
||||
selectionBox = new SelectBox(40,40,getMaxLife());
|
||||
selectionBox = new SelectBox(0,40,40,getMaxLife());
|
||||
}
|
||||
|
||||
protected SelectBox getSelection() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue