In forums MaxDevil said:
"I wish when i press Space it will create an object and after XXsecs he is destroy."
In order to achieve this you need two objects, one object that will react to the key press event and the object that will destroy itself. Start by adding the key press event to the first object and add this piece of code:
instance_create(x,y,object1);
Then in the create event of object1, which is the created object, you put the following:
alarm[0] = t*1000;
t is the number of seconds. Event alarm[0] will be executed in t seconds because it is set in milliseconds, which is 1/1000 of a second.
Consequently, in the event alarm[0] you put instance_destroy(); and that's it!
.
Users logged in:
Comments
Loading comments...