Collision Help

Started by Mr.Trant, Tue 05/08/2003 21:42:17

Previous topic - Next topic

Mr.Trant

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???

Gankkizz

#1
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.

SMF spam blocked by CleanTalk