How can I add multiple objects of an Action class and move them at intervals dynamically


// instance field private int spawnRate; // add in 'act' method checkSpawning(); // add this method private void checkSpawning() { spawnRate = (spawnRate+1)%100; // adjust last value to change the rate if (spawnRate == 0) addObject(new ActorName(), /* xLocation, yLocation */ ); }