Game slows down over time

Discussion and feedback on Construct 2

Post » Mon Nov 07, 2011 11:03 am

Would be very grateful for any help on why my 'test game' slows down over time. The simple game just uses a spacebar to shoot buttets! If the game is left on the screen without any interaction after about 5 minutes the objects have really slowed down and the bullets crawl up the screen.
Not sure what the problem is... coding, bad graphics, my computer...It seems to have similar effect played locally or from the internet.
I am using release 65.
Construct file is at: www.specialbites.com/Test/testspeed.capx
Game is at: www.specialbites.com/Test/index.html

Many thanks in advance
B
3
G
1
Posts: 10
Reputation: 595

Post » Mon Nov 07, 2011 11:20 am

its always handy to have a text object show the total objects, = set text to system totalobjects, now when you shoot the objects the objectcounts is raising fast...

i think the problem is that you use the spawn explosion, use the system create explosion and dont forget to destroy the explosion when alpha=0 or end of animation.

also the ticks, you have a variable that when = 1,2,3 create objects,
you should put a system trigger once condition with it otherwise it will continue to create objects when = to that numbervtrix2011-11-07 11:29:41
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Mon Nov 07, 2011 11:27 am

If you add a new txt object and populate it with:

"FPS: " & fps & " TickCount: " & tick.Count & " DashCount: " & dash.Count

This just shows how many 'Ticks' and 'Dashes' are created when your events ask for it.

You'll see the problem instantly. When you press space, it's creating a bucket load!!!

Quick fix is to use Trigger Once as another condition on Event 8 and onwards.

Better fix is to redo that whole section for displaying ticks and dashes.zenox982011-11-07 11:56:19
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,844
Reputation: 48,289

Post » Mon Nov 07, 2011 12:09 pm

Thanks for the replies. Novice at work here! I now understand the problems. Novice will now work on solution. Thanks very much for you help.
B
3
G
1
Posts: 10
Reputation: 595

Post » Mon Nov 07, 2011 12:27 pm

Not a problem. Trying out things is the best way to learn, and using debug messages can be a life-saver (or brain saver) :)
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,844
Reputation: 48,289


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests