public void process() { super.process(); if (this.target == null) { if (this.getCurrentMapSquare().owner != this.side) { // Bring us home if (mp == null) { mp = this.findClosestMiningPlatform(this.side); } if (mp != null) { this.moveTowards(mp); } } else { mp = null; } } else { if (this.did_shoot == false) { // We have a target but we're not close enough this.moveTowards(target); } } }
@Override public void harm(float damage) { super.harm(damage); mGame.getListener().onTowerInjure(this); }
public void paint(Graphics g, int centre_x, int centre_y) { g.drawImage( main.getImage("tank" + side + ".png"), (int) (x - centre_x), (int) (y - centre_y), main); super.paint(g, centre_x, centre_y); }