input stuff

This commit is contained in:
Jesper Lundin 2007-04-18 09:20:00 +00:00
parent 6873572994
commit 99a30c2e8d

View file

@ -56,7 +56,12 @@ public class InGameMouseInput extends MouseInput{
LWJGLGameWindow.getCamera().getLocation().getX()+x,
LWJGLGameWindow.getCamera().getLocation().getY()+y);
//selecting unit.
if(!map.isPosEmpty(pos.getX(), pos.getY())){
if(event==RIGHT_MOUSE_BUTTON) {
for(int i=0; i<selected.size(); i++) {
selected.get(i).attack(new Vector2f(pos.getX(), pos.getY()));
}
}
else if(!map.isPosEmpty(pos.getX(), pos.getY())){
//map.printAllUnits();
for(int i=0; i<selected.size(); i++) {
selected.get(i).setSelected(false);
@ -73,6 +78,7 @@ public class InGameMouseInput extends MouseInput{
selected.get(i).move(pos.getX(),pos.getY());
}
}
}
@Override