Fangames > Programming Questions

Fading Spikes (need for coding help)

(1/1)

Taprus:
I am currently trying to do a spike that, when a trigger is triggered, it fades away and then detroys itself (stops killing the player).
The thing is, I can make it fade away, but it still kills you, and I know I have to make an alarm event that starts when a certain trigger is triggered and that alarm then destroys the object ( instance_destroy () )
But i dont know how to incorporate such thing!
Any help pls  :atkCry: ?

ilvpag:
I'm assuming you're using this to fade out the spike:


--- Code: ---image_alpha -= fadeOutSpeed;
--- End code ---

and if this is the case, just put this in the step event of the spike:


--- Code: ---if(image_alpha <= 0){ instance_destroy(); }
--- End code ---

Taprus:
Well, I did something stupid nowl, I wasnt using the code you said, so I changed my code, didnt know how to use it, so it didnt even fade (nor disapear) and now I dont even remember my old code  :atkCry:
Could anyone help me how to do this ? (Im just doing this because I dont like how the faling/rising look, so I want something better)
I am even more confused than before

pieceofcheese87:
just copy this into the step event:

image_alpha-=0.02
if image_alpha<0{instance_destroy()}

Taprus:
It works now !
Thanks cheese  :atkLove:

Navigation

[0] Message Index

Go to full version