GMS 2 How do I add an enemy death if I have a sprite for it? (drag and drop version, GameMaker 2)

W

Wack

Guest
I want my enemy death so when the enemy itself is destroyed, then my death sprite will replace it, and fade away to transparent (or 0) I also want it so that when the enemy dies, it scales the enemy death to be bigger. Help? Respond ASAP.
 
D

Deanaro

Guest
create a new object called "obj_Death", give it the death sprite and place this in the steps event:
Code:
//lowers transparency every step
image_alpha -= 0.01;
//checks if its completely transparent
if image_alpha = 0
{instance_destroy();}
and in the enemy code before the "instance_destroy()" is called, paste this:
Code:
instance_create(x,y,obj_Death);
 

Gamerev147

Member
create a new object called "obj_Death", give it the death sprite and place this in the steps event:
Code:
//lowers transparency every step
image_alpha -= 0.01;
//checks if its completely transparent
if image_alpha = 0
{instance_destroy();}
and in the enemy code before the "instance_destroy()" is called, paste this:
Code:
instance_create(x,y,obj_Death);
^^ Drag and Drop would be almost the exact same if that's what you need.
I'd be happy to give you extra help @Wack if you need it.
 

matharoo

Tutorial Guy
YYG Staff
Create an object with the enemy death sprite, and in the enemy object's Destroy event, make an instance of it.

Then in the enemy death object, use these actions to make it disappear while increasing in size.
 
Top