Lifetime of an instance

V

Vectrex71

Guest
I try to give an instance a lifetime from 60 steps (1sec) but i'm in the learning process and new to Game Maker. So i guess it has something to do with alarms ...right ?

what i'm looking for is something like instance_destroy(after 60 steps)

can someone guide me to the right direction please ?!

Thanks !
 

Roderick

Member
Whenever you want to start counting, set an alarm. For example

Code:
alarm[0] = room_speed * 60;
This sets an alarm for (however many steps you run per second) times 60 seconds.

Then, in the Alarm[0] event, put

Code:
instance_destroy();
Never put anything in the brackets for instance_destroy, because it doesn't accept any arguments. However, as a function, it does still require them there.
 
V

Vectrex71

Guest
Thank you very much !! I'm sure this will help me ! Have a nice day !
 
Top