Objects revival

Get help using Construct 2

Post » Tue Dec 02, 2014 3:04 am

Regarding game performance, I have some objects in the game that are being eliminated during game play
and when the game starts a new round these objects should appear again.
My question is what's the best way to eliminate them, regarding game performance:

Option 1: Make them unvisible and then visible again.
Option 2: Destroy them and create them again.
Option 3: Move them outside the game boundaries (x,y position) and move them back inside again.

Thanks in advance.
B
5
S
1
Posts: 22
Reputation: 417

Post » Tue Dec 02, 2014 4:22 am

all three work and are ok to use. option 1 or 3 are best if it needs to happen alot creating alot of objects(2) can hurt performance. but really it only matters if you see a noticeable performance loss

you should check these out they are helpful on performance
https://www.scirra.com/blog/112/remembe ... our-memory

https://www.scirra.com/tutorials/577/co ... imisations
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Tue Dec 02, 2014 7:52 pm

Option 1 & 3, Never destroy objects that you will reuse in the level, creating a object is very time consuming and can affect your performance.

I recomend you to move them outside boundaries so webGL doesnt render them, then disable any collisions or phisics applied to them so the cpu doesnt have to calculate that
Image
B
15
S
4
G
4
Posts: 134
Reputation: 3,177


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 27 guests