LOL
This commit is contained in:
parent
2cf489403d
commit
515281351c
10 changed files with 64 additions and 17 deletions
|
|
@ -127,14 +127,29 @@ public class InGameMouseInput extends MouseInput{
|
|||
//unit action.
|
||||
else if(event==RIGHT_MOUSE_BUTTON) {
|
||||
if(!map.isPosEmpty(pos.getX(), pos.getY())){
|
||||
int rand = (int)(Math.random()*selected.size());
|
||||
for(int i=0; i<selected.size(); i++) {
|
||||
selected.get(i).attack(new Vector2i(pos.getX(), pos.getY()));
|
||||
if(rand==i) {
|
||||
selected.get(i).attack(new Vector2i(pos.getX(), pos.getY()), true);
|
||||
}
|
||||
|
||||
else{
|
||||
selected.get(i).attack(new Vector2i(pos.getX(), pos.getY()), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
//MultiPrintStream.out.println("Moving: "+pos.getX()+", "+pos.getY());
|
||||
int rand = (int)(Math.random()*selected.size());
|
||||
for(int i=0; i<selected.size() ;i++){
|
||||
selected.get(i).move(pos.getX(),pos.getY());
|
||||
if(rand==i) {
|
||||
selected.get(i).move(true, pos.getX(),pos.getY());
|
||||
}
|
||||
|
||||
else{
|
||||
selected.get(i).move(false, pos.getX(),pos.getY());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue