Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public long lastShotTime;
- public void searchAndDestroy(ArrayList<Attacker> attackers, Player p) {
- ArrayList<Attacker> newattackers = attackers;
- for(Attacker a : newattackers) {
- if(area.contains(a.getX(), a.getY())) {
- if(a.getHP() > 0) {
- if(System.currentTimeMillis() - lastShotTime > speed) {
- a.getHit(this.damage, this);
- lastShotTime = System.currentTimeMillis();
- if(a.getHP() <= 0) {
- toberemoved.add(a);
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment