How do you make a sprite only spawn one sprite at a time?

Get help using Construct 2

Post » Sat Aug 15, 2015 4:25 pm

I want my sprite to spawn another sprite at a certain position. The problem is that if you create an invisible sprite at that location and make it so that the sprite spawns to other sprite on collision whit or overlapping offset whit the invisible sprite the sprite will spawn the another sprite infinitly. I want to only be able to have one of the spawn object in the game at the time. I tried making events that would do that.


http://postimg.org/image/3szwd8bvf/


I created a instance variable called Amount and tried making it so when too much sprites would be on screen they would get destroyed. The problem is that all versions of the sprite get destroyed when the amount is reached not just the last spawned one. It mamkes the sprite not spawn anything. Is there a way make it os only a certain amount of one sprite can be in the game at once otherwise no more can be spawned?
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Sat Aug 15, 2015 4:45 pm

On collision should only trigger once, for it is a triggered event..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Aug 22, 2015 8:15 pm

LittleStain wrote:On collision should only trigger once, for it is a triggered event..



I changed from overlapping at offset to on collision whit and now it worked. But i have another similiar problem. I have set a sprite to spawn another sprite on line of sigth whit another sprite. The problem is that it doesn't just spawn one sprite, rather one sprite per frame so it spawns alot. How can i make it just spawn one sprite on line of sigth?
B
12
S
2
Posts: 267
Reputation: 1,344


Return to How do I....?

Who is online

Users browsing this forum: Julot135 and 26 guests