Thursday, August 11, 2011

Trying to create a growth loop in java?

In java, I'm completing a class for a game that creates circles and makes them grow at a certain rate until they reach their maximum radius and pop, unless the user clicks on the circle to pop it themselves. the rest of the program is written, however the class i need to write is the one which creates the circles and defines the growth amount. I have gotten through creating circle based on given points and radii, with a grow method that states the current radius becomes the starting radius + growth amount. however, I can't figure out how to loop the circle back to the grow method IF the current radius hasn't reached its given pop radius. I was required to create a boolean method that answers the question "has the circle popped?". Do i need to create a loop within this method or declare it somewhere else? how do i return to the grow method if it hasn't popped? I'm not sure about the actual time increments, I can play with that after i get the program running, i just need to get the growth function working (i can start using an increment of 1000ms).

0 comments:

Post a Comment