Added ui to the engine and buttons and implemented them in the game fixed also a mouse position problem
This commit is contained in:
parent
515281351c
commit
728a68cc48
35 changed files with 436 additions and 23 deletions
|
|
@ -23,7 +23,7 @@ public class Map {
|
|||
|
||||
public static final int OBJ_STONE = 1;
|
||||
|
||||
private static final int POS_SIZE = 50;
|
||||
public static final int POS_SIZE = 50;
|
||||
private int width;
|
||||
private int hight;
|
||||
private GameEntity[][] map;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public abstract class Building extends GameEntity{
|
|||
buildQueue = new LinkedList<Unit>();
|
||||
unitNode = new Node("UnitNode");
|
||||
unitNode.setLocation(Map.getPixelByPos(pos.getX(), pos.getY(), this.size));
|
||||
System.out.println("location: "+unitNode.getLocation());
|
||||
setPos(pos.getX(), pos.getY(), this.size);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class CommandCenter extends Building{
|
|||
|
||||
public CommandCenter(int x, int y, Player p){
|
||||
super(1000, new Vector2i(x,y), p, 4);
|
||||
this.sprite = new Sprite("APU", "data/buildings/commandcenter.png");
|
||||
this.sprite = new Sprite("APU", "data/buildings/cc/cc.png");
|
||||
sprite.setSize(new Vector2f(200,200));
|
||||
getNode().add(sprite);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import ei.engine.math.Vector2f;
|
|||
import ei.engine.math.Vector2i;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.sound.Sound;
|
||||
import ei.engine.texture.AnimatedTexture;
|
||||
import ei.game.player.Player;
|
||||
import ei.game.scene.SelectBox;
|
||||
import ei.game.scene.weapons.BomberWeapon;
|
||||
|
|
@ -24,7 +25,15 @@ public class Bomber extends Unit{
|
|||
|
||||
public Bomber(int x, int y, Player p){
|
||||
super(200, new Vector2i(x,y), p);
|
||||
this.sprite = new Sprite("Bomber", "data/units/bomber/bomber0000.png");
|
||||
AnimatedTexture tex = new AnimatedTexture("BomberTexture");
|
||||
tex.addAnimation("normal", new String[]{
|
||||
"data/units/bomber/bomber0000.png",
|
||||
"data/units/bomber/bomber0001.png",
|
||||
"data/units/bomber/bomber0002.png",
|
||||
"data/units/bomber/bomber0003.png"
|
||||
});
|
||||
tex.setDelay(5);
|
||||
sprite = new Sprite("Bomber",tex);
|
||||
sprite.setSize(new Vector2f(50,60));
|
||||
getNode().add(sprite);
|
||||
setBuildTime(40);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue