As you may know, GameMaker Language has a Pascal-like "with" structure:
with (value) { code }
but it's not exactly like the Pascal version. In GameMaker, it can take an instance:
var bullet = instance_create(x, y, obj_bullet); with (bullet) direction = 180;
or an object type (and will apply the expression to each instance of it):
with (obj_bullet) instance_destroy();
This can be rather handy under the multiple circumstances.
However, initially the same block can not be applied to multiple values, and that's less handy.
Sometimes you can cheat by applying the expression to a shared "parent" type of objects, but that is not always the case (and can have side effects if there are more object types meeting the condition).
So let's consider your options for applying a piece of code to all instances of several types: }
Continue reading