• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to trigger blood on enemy death?

EpicMcDude

Member
Hey all,

I'm new to programming and was following a tutorial on how to make blood. Of course, this tutorial to show the blood, the particles look great and it triggers when I click the mouse as a Step even on the object Blood Controller.

var count = random_range(4,32);
if(mouse_check_button_pressed(mb_left)){
for(var i = 0; i<count; i++){
instance_create_depth(mouse_x,mouse_y, -10,obj_Blood);
}
}


But how do I replace this, to trigger upon killing an enemy? I've searched and can't find anything, sorry not sorry for the noob question!

Thanks!
 

Attachments

Mk.2

Member
The same way you're already doing it, except place it right before your enemy's instance_destroy (or in their death state if it has one). Remove the mouse check and replace the mouse_x and mouse_y coordinates with the enemy's coordinates.
 

EpicMcDude

Member
The same way you're already doing it, except place it right before your enemy's instance_destroy (or in their death state if it has one). Remove the mouse check and replace the mouse_x and mouse_y coordinates with the enemy's coordinates.
Wow, that was easy, my mind was drawing blanks!
Thank you so much for your reply.
 
Top