JavaScript Stack Error on a Prototipe

Get help using Construct 2

Post » Wed Jul 13, 2016 9:50 am

So i'm making this prototipe of a game where you spawn troops to try and destroy the enemy's turret and you get some enemys spawning from the other side, i'm using
rectangles to check if the enemy is overlaping it so it takes damage.
But for some reason that i cant figure out i'm getting an stack error from java script.


Here is my event sheet:
www.
dropbox.com/s/c5emeadxin6ubjc/Backup.capx?dl=0


Sorry can't post with links I'm very new to the construct engine and comunity.
B
3
Posts: 3
Reputation: 183

Post » Wed Jul 13, 2016 10:48 am

I think if might be because of the amount of overlapping checks? Any Light on the subject?
B
3
Posts: 3
Reputation: 183

Post » Wed Jul 13, 2016 12:11 pm

You made a neverending 'on create' loop.

When you have a bunch of objects in the layout, they count as 'just created' when running that layout.

So, the 'on create' events you made, they create a new object for each object in the layout, and then kicks in again on those newly created ones. Result: a neverending loop.

Solution: Destroy them in the 'on start of layout'
And use containers to pair sprites with theire helper sprites.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests