Sprites spawning immediately - not after set time

Discussion and feedback on Construct 2

Post » Sat Jul 27, 2013 7:17 pm

Please post your questions in the how do I section ...

For the timer , I think the timer fires once and then starts counting
I'm not sure about this ...

You could try and fix it by adding a global boolean (TimerSet) to the object

And add the following script to your game

Ontop of your every X seconds condition
Add Is TimerSet

and just below your spawning scripts
Trigger once
-- Set TimerSet to true

I am not sure if that fixes the problem , but you could try it out !
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Sat Jul 27, 2013 11:15 pm

[QUOTE=Bl4ckSh33p]
Any idea why it starts to lag after a while? [/QUOTE]
You're creating a lot of HUDRocket sprites. See in event 22 it's constantly creating new sprites when RocketsAvailable > 0. It's always good to always display objectcount in your debug text. You'll see when you collect the first rocket the objectcount starts rising rapidly.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sun Jul 28, 2013 7:48 am

I am still very new to Construct 2 and need to learn a few things and tweaks. Thank you very much to both of you. I will try your suggestions.

/Edit: OMG! I added objectcount and it creates about 1000 rocket objects for each one collected. I will try to fix this now.
I added a global var to check if an HUD updated is needed (after collecting one it is set to 1)


This seems to fix the huge amount of objects and the lag when you launch rockets. Thank you! Bl4ckSh33p2013-07-28 08:05:30
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests