input stuff
This commit is contained in:
parent
6873572994
commit
99a30c2e8d
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue