I'm very new to java and Greenfoot and I don't know how to code a visual counter on screen, my counter code is currently like this -->
And I want to kill one actor (Let the other actor win) when the other Touches him This was my attempt
Thx for the Help
private void aufsammeln() { Actor Schatz = getOneObjectAtOffset(0, 0, Schatz.class); if(Schatz != null) { getWorld().removeObject(Schatz); SchatzG++; System.out.println("Punkte Abenteurer = " + SchatzG); } } private int SchatzG = 0;
public void Toeten() { Actor Waechter = getOneObjectAtOffset(0, 0, Abenteurer.class); if(Waechter != null) { Greenfoot.stop(); } }