[HELP] Re-Spawn doubles Sprites

Get help using Construct 2

Post » Mon Dec 19, 2011 6:07 pm

Little ole stupid me again...

In my Bathtub-Shooter something strange happens, when the game is restarted. Even though all Globals get reseted, the "new spawn" creates twice as much instances as in the run before.

Here are the code-snippets that are envolved:





Here is the CAPX

...and here the online game...

QUAK

Where did I goof?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Mon Dec 19, 2011 9:05 pm

Remove the for each conditions from the "REZiele" and "RESchaume" functions. They are not needed to destroy all the objects and they are causing the spawn to be called once per object destroyed.
B
79
S
24
G
53
Posts: 4,735
Reputation: 40,233

Post » Tue Dec 20, 2011 10:06 am

Thanks for your Reply. I changed the code to:



but it changed nothing :-(
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Dec 21, 2011 4:28 am

I found a work-around by changing the code to



...but that didn't explain why this has happend
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Dec 21, 2011 7:20 pm

I haven't opened you cap but are you sure you are resetting the global variables "count" and "schaum" when you reset?
B
79
S
24
G
53
Posts: 4,735
Reputation: 40,233

Post » Thu Dec 22, 2011 1:46 pm

I allways thought, that this should do the trick?!

B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to How do I....?

Who is online

Users browsing this forum: jobel, Timedoor Indones and 24 guests