Theory: Which is better?

Get help using Construct 2

Post » Wed Sep 03, 2014 6:46 pm

Is there a difference in the following events:

For Each BulletObject: ----------- Subtract dt from BulletObject.Life

...compared to...

Every Tick ---------------------------- Subtract dt from BulletObject.Life



They seem to do exactly the same, and in used in such a basic manner there seems to be no difference. Does one use more overhead? I always heard that "for each object" could take time to loop through, but isn't that the same as looping through the list of picked objects?
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Wed Sep 03, 2014 8:46 pm

For each is for uses where the events are not looping through all the instances (I cannot think of an exemple right now other than the on timer condition), use the everytick in that case, since they are all picked and executed together
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair, Fenix18 and 46 guests