Guest User

Untitled

a guest
Jun 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public long lastShotTime;
  2.  
  3. public void searchAndDestroy(ArrayList<Attacker> attackers, Player p) {
  4. ArrayList<Attacker> newattackers = attackers;
  5.  
  6. for(Attacker a : newattackers) {
  7. if(area.contains(a.getX(), a.getY())) {
  8. if(a.getHP() > 0) {
  9. if(System.currentTimeMillis() - lastShotTime > speed) {
  10. a.getHit(this.damage, this);
  11. lastShotTime = System.currentTimeMillis();
  12. if(a.getHP() <= 0) {
  13. toberemoved.add(a);
  14. }
  15. }
  16. }
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment