Python and containers

For questions about using Classic.

Post » Thu Mar 08, 2012 6:22 pm

Is there any way to go through all of the objects of a given container?
I did it with nested for loops and some variables, but if there is lots of objects it's slows down as hell of course.
B
10
S
6
G
3
Posts: 127
Reputation: 2,481

Post » Fri Mar 16, 2012 2:45 pm

Well, I found a workaround for this, it's still not quick enough, but way better than my original solution.

If someone is intrested in this in the future...
When you loop through an object's instances in the event editor, it's picking the other objects in the same container, so this way it works.


+ System: For each a
SOL.b.x = SOL.a.X
SOL.c.x = SOL.a.X
etc

I tried this with 15 object, if I only use events it's running @2200-2300fps, this way 900-1200fps, and in pure python I got only 200-220fps(ouch).

Note: these values can be a lot higher(I've got the same fps with the mixed solution when I only checked them every 20-30ticks) if you not loop through all of them every thick, but that is only in option if you don't use vsync of course.
B
10
S
6
G
3
Posts: 127
Reputation: 2,481


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests