Fixed som bugs with unit

This commit is contained in:
Ziver Koc 2007-04-16 16:13:44 +00:00
parent da8ec6f899
commit a7749878f0
3 changed files with 9 additions and 7 deletions

View file

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