Multiple/Infinite Sprite(s)

I’m developing a basketball game where there are levels and challenges etc and each levelight have 3 or 4 balls to try and succeed. Each time the ball is thrown the process is:
Camera follows ball
When isHit timer starts
When timer finished, new round is called
‘Old’ ball disappears
‘New’ ball rolls in
Start over.

What I want to do now is create a free throw or practice round where there are an infinite amount of ‘lives’ and a 90 second time limit to basket as many as possible. Once isHit each ball might last 6 or so seconds before disappearing, but in that time the player could have thrown another 4 balls ( maybe more ).

Using my existing code I tried to assign a new ball object to free up the main ballObject so it could. E thrown again but this was messy and didn’t really work.

Is there an easy way to manipulate a single main object code to do what I want or do I need to do the ball object code over with a different method.

Any help is greatly appreciated [import]uid: 157954 topic_id: 30946 reply_id: 330946[/import]

I think you’d probably be best creating a ‘pool’ of ball objects. So when the game starts, create 10 or so ball objects and make them invisible. When the player throws a ball, grab the next available ball in the pool (i.e. one that’s invisible) and use that as your current ball. Also, when you detect that a ball has finished it’s acting (after 6 seconds or whatever) just make that ball invisible again (so it’s available in the pool again)

If there isn’t an available ball either grab the first ball used and use that (as it’s probably been sitting there for a while doing nothing on screen), or start with a larger ball ‘pool’.

I’d put the ball object references in a table, so you can keep track of them too. [import]uid: 87794 topic_id: 30946 reply_id: 123835[/import]

I think you’d probably be best creating a ‘pool’ of ball objects. So when the game starts, create 10 or so ball objects and make them invisible. When the player throws a ball, grab the next available ball in the pool (i.e. one that’s invisible) and use that as your current ball. Also, when you detect that a ball has finished it’s acting (after 6 seconds or whatever) just make that ball invisible again (so it’s available in the pool again)

If there isn’t an available ball either grab the first ball used and use that (as it’s probably been sitting there for a while doing nothing on screen), or start with a larger ball ‘pool’.

I’d put the ball object references in a table, so you can keep track of them too. [import]uid: 87794 topic_id: 30946 reply_id: 123835[/import]