Fixed som bugs with unit
This commit is contained in:
parent
da8ec6f899
commit
a7749878f0
3 changed files with 9 additions and 7 deletions
|
|
@ -35,11 +35,13 @@ public abstract class Unit extends GameEntity{
|
|||
*
|
||||
* @param l The max life of the unit
|
||||
*/
|
||||
public Unit(int l) {
|
||||
public Unit(int l, Vector2i pos) {
|
||||
super(l);
|
||||
unitNode = new Node("unit");
|
||||
setPos(0, 0);
|
||||
unitNode.setLocation(Map.getPixelByPos(pos.getX(), pos.getY()));
|
||||
setPos(pos.getX(), pos.getY());
|
||||
}
|
||||
|
||||
public void setSelected(boolean b) {
|
||||
super.setSelected(b);
|
||||
if(b) {
|
||||
|
|
@ -66,8 +68,7 @@ public abstract class Unit extends GameEntity{
|
|||
*/
|
||||
public void setPos(int x, int y) {
|
||||
oldPos = new Vector2i(x, y);
|
||||
InGameState.getMap().setPos(this, x, y);
|
||||
|
||||
InGameState.getMap().setPos(this, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue