This commit is contained in:
parent
cfb69a3037
commit
f95dfe082b
1 changed files with 2 additions and 1 deletions
|
|
@ -232,7 +232,8 @@ public abstract class Unit extends GameEntity{
|
||||||
}
|
}
|
||||||
else if(attack != null){
|
else if(attack != null){
|
||||||
Weapon wepon = getWeapon(new Vector2f(unitNode.getLocation().getX(), unitNode.getLocation().getY()));
|
Weapon wepon = getWeapon(new Vector2f(unitNode.getLocation().getX(), unitNode.getLocation().getY()));
|
||||||
Vector2i enamyPos = Map.getPosByPixel(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY());
|
Vector2i enamyPos = Map.getPosByPixel(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()+1);
|
||||||
|
|
||||||
if(wepon.onRange(new Vector2f(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()))){
|
if(wepon.onRange(new Vector2f(attack.getNode().getLocation().getX(), attack.getNode().getLocation().getY()))){
|
||||||
if(weponTimer >= wepon.getReload()){
|
if(weponTimer >= wepon.getReload()){
|
||||||
wepon.launch(enamyPos);
|
wepon.launch(enamyPos);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue