Uh, I'm showing my js noobery here, but for the life of me, I don't understand this entry in the manual:
*pickedInstances()
Iterates over the instances that have been picked by the event's conditions. This is only useful with scripts in event sheets.
How do I use it?
For general instances I would do something like this:
const enemies = runtime.objects.enemies.getAllInstances()
enemies.foreach((i) => {
Utils.DoSomething(i, 60*runtime.dt);
});
//or
for(let i = enemies.length(); i>= 0; --i) {
Utils.DoSomething("42");
}
I tried to look up iterators for js but didn't really get what construct is doing here. Any help is appreciated!