I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: RedSalamando on July 13, 2014, 11:31:04 AM

Title: The simplest of Triggers
Post by: RedSalamando on July 13, 2014, 11:31:04 AM
I just got into fan-game making yesterday, using Klazens well made guide on how to start, Ive gotton the hang of things, but theres just one thing I'm not understanding. And its probably the most vital of a fan-game.

I'd like to know how to make a trigger that destroys itself (you know, so the action cant happen again), and makes an object move in from somewhere, or say move a spike upwards until a certain position is reached (like hitting another invisible trigger to stop it from continuing).

I've read the guide a couple of times attempting to figure it out, but its all gibberish to me.
Title: Re: The simplest of Triggers
Post by: YoSniper on July 13, 2014, 02:25:02 PM
Upon collision with the trigger, you can tell the trigger instance to destroy itself. As in:

Code: [Select]
with(other) {instance_destroy();}
Just put that at the very end of the collision code. That should do the trick.
Title: Re: The simplest of Triggers
Post by: RedSalamando on July 13, 2014, 03:55:06 PM
Thanks! I've got it down now!