Author Topic: Fading Spikes (need for coding help)  (Read 2028 times)

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Fading Spikes (need for coding help)
« on: May 23, 2015, 11:30:10 PM »
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: ?
I'm somewhat decent at video games

ilvpag

  • Guest
Re: Fading Spikes (need for coding help)
« Reply #1 on: May 23, 2015, 11:44:56 PM »
I'm assuming you're using this to fade out the spike:

Code: [Select]
image_alpha -= fadeOutSpeed;
and if this is the case, just put this in the step event of the spike:

Code: [Select]
if(image_alpha <= 0){ instance_destroy(); }

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Re: Fading Spikes (need for coding help)
« Reply #2 on: May 24, 2015, 03:43:35 PM »
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
I'm somewhat decent at video games

pieceofcheese87

  • Global Moderator
  • The Kid
  • Posts: 346
  • Personal Text
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 43.0.2357.65 Chrome 43.0.2357.65
    • View Profile
    • Twitch Tv Channel
  • Playstyle: Keyboard
Re: Fading Spikes (need for coding help)
« Reply #3 on: May 24, 2015, 04:23:46 PM »
just copy this into the step event:

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

Taprus

  • Cherry Eater
  • Posts: 58
  • idkman
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Re: Fading Spikes (need for coding help)
« Reply #4 on: May 24, 2015, 05:43:47 PM »
It works now !
Thanks cheese  :atkLove:
I'm somewhat decent at video games