I have the following while loop, but the game doesn't show, which usually happens when you have an endless while loop.
Here's the loop:
When the Tumbler (Batman car) touches a coin, it should eat it and the field points should be increased with one. Why doesn't this loop work? The condition is that as long as you don't have 30 points, the Tumbler should collect coins and with every collected coin, the points should increase with one.
How can I change this code to make it work?
public void getCoin() { int points = 0; while (points < 30){ if (canSee(Coin.class)){ eat(Coin.class); } points = points + 1; } }