PC Freezes

Just started using Construct 2? Post your questions here

Post » Mon Apr 06, 2015 3:29 pm

So I'm testing out my game, it's no where near a complicated or sophisticated game, but every time I leave it running for a little bit it slows my pc until it starts freezing. It seems to only happen when I'm trying to stop the game after the timer goes out, all the objects except the backgrounds get destroyed and text comes up saying time's up!
It only happens when I add the condition for when timer = 0 then it destroys all the objects individually then spawns the Time's up! text in the center of the screen.
But if i take the condition away the game is fine if I leave it running, but adding that and process in the task manager goes up to like 1,000,000K in the memory, so does anyone know what is causing this issue?
B
4
Posts: 12
Reputation: 224

Post » Mon Apr 06, 2015 4:41 pm

when timer = 0 ..................................................then spawns the Time's up!
Trigger once while true
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731

Post » Mon Apr 06, 2015 6:00 pm

I'm not quite understanding your post, not sure if you're trying to answer the question? When the timer = 0 the Time's up text does spawn, everything works as intended, it's just that it starts making my pc freeze for no apparent reason.
B
4
Posts: 12
Reputation: 224

Post » Mon Apr 06, 2015 6:36 pm

are you using condition " Trigger once while true"
when your spawn text?


https://www.scirra.com/tutorials/292/gu ... t-features
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731

Post » Mon Apr 06, 2015 6:44 pm

I think korbaach is implying that the reason your pc is slowing down is it is creating something constantly - a cascade - and the trigger once will stop that. You can see if this is the case using the debugger.

Alternatively, post either your .capx or screenshots of your events. That way, you'll get direct help rather than just guesswork.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,194
Reputation: 54,293

Post » Mon Apr 06, 2015 6:47 pm

Ok, so you saying that made me realize my mistake, I was using the compare variable, the variable being "timer". I thought that it would only go through the condition once, but it was continuously spawning them over each other adding more and more until it started to freeze up the computer because "timer"=0.
So I've added the trigger once while true after that and it seems to be working now.
Thanks!
B
4
Posts: 12
Reputation: 224

Post » Mon Apr 06, 2015 7:17 pm

Thanks for the help @zenox98 :)
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests