I am new in Construc2 and have very simple and dump question:
How do I using Max expression ....???
Problem is: I have many object and each object have it own IDD. How do I get object have highest IDD to pick and destroy..I don't want to using for - loop to save game performance...
Thank in advance
It's much simpler if you use a loop to find the instance with the highest value like in this post:
If you want to use the max() expression to do the same thing you will still need a loop.
global number highest_idd
set highest_idd to 0
for each sprite
set highest_idd to max(highest_idd, sprite.idd)
sprite: idd equal to highest_idd
Develop games in your browser. Powerful, performant & highly capable.
Thank to much for your reply. Actually, my game until now have more than 150 events and I really confuse about it's performance...??
Number of objects around 50 so and there are no way to avoid loop..??..:(
I got another question...What is faster...??? Using native system expression/event/condition or try to put some of them in my own plugin...??.
Thank a lot for your help