I need a way to count how often a target has been hit by a bullet. This code is in the bullet class:
This is the code in my world which should transfer the information of a bullet hit to increasing the "treffer" counter. However I get the error message: "Undeclared method: hit()".
Help of any kind would be greatly appreciated!
public boolean hit() { if(isTouching(Feind1.class)) { return true; } }
Actor bullet = (bullet) getObjects(bullet.class).get(0); if (bullet != null) { if (bullet.hit()) { treffer++; } }