Throw and retrieve actor

Non-platform specific questions.

Throw and retrieve actor

Postby stevirt » Sat Feb 11, 2006 7:31 am

Hey,

I am having some trouble with creating an actor only when one is not on screen. I shoot a ball and if it hits the correct object then it is destroyed - fine. If it hits the wrong object it just sticks to it - this is working and just what I want. My problem is that if the ball is stuck to an object or if it is flying through the air then I don't want to be able to create another one. So there is just one ball that you throw and go pick up again. Is there a way to create on actor only if that actor is not anywhere on screen?

Thanks for any help!!
stevirt
 
Posts: 9
Joined: Fri Feb 10, 2006 4:27 am
Score: 0 Give a positive score

Postby Fuzzy » Sat Feb 11, 2006 10:06 am

its essentially the same problem as being able to jump while already jumping. Set a variable that tells the actor when it is permissable to throw.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby stevirt » Sat Feb 11, 2006 5:40 pm

Ok. But what can I use to tell it that it is ok to throw? Can I say "if the actor exists, don't create another one."? Sorry, I'm new to this - having fun and spending too much time doing it, but still feeling my way around.
stevirt
 
Posts: 9
Joined: Fri Feb 10, 2006 4:27 am
Score: 0 Give a positive score

Postby stevirt » Sat Feb 11, 2006 5:49 pm

Nevermind! Threefinger Pete, you were more helpful than I thought. I just had to think about what you said for a minute. When the ball is thrown, the variable=1, when it is picked up again, the variable=0 - only allow the ball to be thrown when the variable=0 - Cool! Thanks!
stevirt
 
Posts: 9
Joined: Fri Feb 10, 2006 4:27 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron