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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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 ; |
1 2 3 4 5 6 7 | public void Toeten() { Actor Waechter = getOneObjectAtOffset( 0 , 0 , Abenteurer. class ); if (Waechter != null ) { Greenfoot.stop(); } } |