Fields of Mistria — Vanilla GML Reference FoM v1.0.8

obj_lightning.gml

object_create(
    "obj_lightning",
    undefined,
    {
        sprite_index: spr_lightning,
        create: function() {
            timer = 0;
            self.draw_blend = [bm_src_alpha, bm_one];
        },
        step: function() {
            self.timer += 1;
            if self.timer >= 10 {
                instance_destroy();
            } else {
                self.image_alpha = random_range(0.85, 1);
            }
            
        },
    }
);