I am making a flappy bird came and i want my coins to spawn at different time throughout the game i have the code and there is no error but it doesn't seem to be working or doing anything. Can someone explain why it isn't working
private int spawnTimer;
private void checkForSpawning() // call from act method
{
spawnTimer = (spawnTimer+1)%600; // repeat every 10 seconds (about)
if (spawnTimer == 0) // at each timer reset
{
addObject(new Coin(), 150, Greenfoot.getRandomNumber(1));
}
}
