Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Mr.Trant on Tue 05/08/2003 21:42:17

Title: Collision Help
Post by: Mr.Trant on Tue 05/08/2003 21:42:17
i am makin this thing where an object moves toward the playable char, and i have a button that makes the char duck, how would i script it so ta if the char hits the button, he lives,and if he doesnt, he dies???
Title: Re:Collision Help
Post by: Gankkizz on Wed 06/08/2003 02:58:49
You could just use an int:

int buttonpressed;
int egodead;

if ((AreCharObjColliding(EGO, 5) == 1) && (buttonpressed == 0)) {    
// if the object is colliding with the character and if the player has not pressed the button...
 egodead = 1;     // ...the character dies...
}
else {
 egodead = 0;      
// ...otherwise, he lives
}


------EDIT------
You could also download 2ma2's platform game if you want to make script which tells you WHERE the object hits the character.