• 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!

GameMaker 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

manualman
GameMaker Dev.
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