Atm I have a box class that I want to be able to add a new box depending on how much time has elapsed. I have an update function with a timer on it to count how many seconds have passed since the program has started as a double. the problem I have is when I call the loadBox method at (if((int) timer == 2)){loadBox();} it adds 30 boxes to the arraylist during the 2 seconds timer is at 2. How do I make it so when the timer is at 2 seconds it only adds 1 box to the arraylist?