how do you limit spawn amount?

For questions about using Classic.

Post » Sun Nov 28, 2010 1:18 pm

hi, i've just gone through the ghostshooter tutorial which was great, and i'm now in the process of making simple changes, in an attempt to use these skills without the tutorial.

I have created a section in the UI for ammo, and managed to get it to display the ammo count, and reduce each time a shot is fired.
However when the private varible of the ammo shot reaches 0 i cannot make the spawn stop.
I have tried selecting when the varible is at 0 the bullet object gets destroyed, but the bullet still flickers up for a second, i've also tried hiding in behind the background, and then using the destroy event but the same thing happens.

Any auggestions?
Thanks for any help you can give

P.s sorry for any bad spelling etc, on my mobile :)
B
2
G
2
Posts: 26
Reputation: 702

Post » Sun Nov 28, 2010 1:29 pm

Well I'm not sure how your events are set up, but usually it's something like:
>private variable is >0
>-on click
Basically your checking that there is ammo, and allowing it to fire in a sub event.
If the first condition is not met the second wont happen.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sun Nov 28, 2010 1:49 pm

thanks thats great, i left the shoot command default, how it was shown in the tutorial, which had just the event to shoot. Just need to make that the sub event of the varible. Cheers for the help much appreciated.
B
2
G
2
Posts: 26
Reputation: 702


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests