How to animate a collision mask? [SOLVED]

Hi Folks,

for being quick:
I have an enemy in my game-project, with a moving core within its body.
The alien-object is moving on its own (the body cannot be injured. But inside of it,
the sensitive core is moving, too. And that core is up to being hit by bullets.

Can anybody tell me, how the collision mask can be moved, frame by frame?
Thank you previously for your hints.
Achie. :)
 

GMWolf

aka fel666
Can you post your solution anyone with the same problem in the future can look at this thread.
 
So sorry, of course I can... so far my small knowledge about programming makes it useful to other ones:

1. Duplicate the sprite of the animated enemy
2. Rename that duplication "mask_col_enemy" (or something you want) ... be sure, that collision mask is set "automatically"
3. Set an empty layer within the sprite editor
4. Paint a one-coloured (animated) shape, fitting to the concerning area, that has to be influentable
5. Delete the layer with the animated enemy (inside of the "mask_col_enemy"-sprite) - you only need the influention-mask, you painted in another layer, over it
6. Click the enemy-object ... Collision Mask ... chose "mask_col_enemy" for the collision mask-import (maybe you have to increase the tolerance of that sprite-mask,
try how good it is to collide/ensure yourself, the collision mask of that object´s sprite is also set "automatically")
7. Now "arm" o_enemy over draw (end) event or step event with
if (place_meeting(x,y,o_bullet)) {
// for being simple:
instance_destroy();
}

That´s just the simplest explanation to use the index_mask... for my opinion so far.
Later, with risen experience, I would certainly do it more professional. ;-)

In spite of that.. I hope it helps somebody, one day.

Greetings, Archie.
 
Last edited:
Top