Getting player character to die

Started by Ali C., Sat 05/03/2005 04:39:09

Previous topic - Next topic

Ali C.

OK, no...not really die, pop up in front of the hospital. I understand exactly HOW to have him reappear in front of a hospital in the game if he gets caught by a monster (i know, weird), but the thing is I can't get him to die if he gets caught. I'm almost certainmy script is right, but maybe you can only use an AreThingsOverlapping command in the global scrpit? Because I need to figure something out because the object numbers are different in every room.
I've checked the manual and it says nothing about where to put the script. I've tried making my own repeatedly_execute section in the room script, just adding it after the player croses the hotspot making the monsters come out, and I still can't get it. :-[

Goot

You probably want to put a script something like this in repeatedly_execute. You don't need to make your own repeatedly execute function, just put it in as an interaction for the room one.

function repeatedly_execute(){
if((character[GUY].x>character[MONSTER].x-20)&&(character[GUY].x<character[MONSTER].x+20)&&(character[GUY].y<character[MONSTER].y+20)&&(character[GUY].y>character[MONSTER].y-20)){

get caught

}

}

basically what that does is checks if the character is within a 20x20 pixel box around the monster. If they are, they get caught. The first three lines would be one line of script.

SMF spam blocked by CleanTalk