Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gord10 on Fri 13/02/2004 14:35:41

Title: My zombie can't kill the player
Post by: Gord10 on Fri 13/02/2004 14:35:41
I'm working on an action-adventure zombie game. You must shoot the zombies before it attacks you. It's OK; it comes through to the player and it dies if you shoot 3 times. But I've got a problem: The zombie can't kill the player character when it reaches him :( Please help me!
PS: I'm sorry if somebody has already asked this question, but I couldn't find such a topic.
Thanks   :)
Title: Re:My zombie can't kill the player
Post by: Scummbuddy on Fri 13/02/2004 14:52:02
Maybe make a region in the lowest section of the walkable area, and have it be, if ZOMBIE is on region for 3 seconds, then player character dies
Title: Re:My zombie can't kill the player
Post by: Squinky on Fri 13/02/2004 16:45:09
If your characeter is able to move, then that solution won't help. If so, do something like this

Rep exec for room

if ((character[ZOMBIE].x==character[EGO].x)&&(character[ZOMBIE].y==character[EGO].y)){

put character death code here

}

This will need some fine tuning prolly...I'm at work and unable to test or grab code from my game (Demonslayer 3) that had this...

Good luck
Title: Re:My zombie can't kill the player
Post by: Gord10 on Fri 13/02/2004 17:10:51
Thanks everybody :)
Title: Re:My zombie can't kill the player
Post by: Scummbuddy on Fri 13/02/2004 18:16:22
in reference to squinky, I was assuming this game was like a zombie shooter, house of the dead.

but you are right, if your char can move around the screen then my solution wouldn't really help
Title: Re:My zombie can't kill the player
Post by: Nine Toes on Fri 13/02/2004 18:59:04
I'm making a similar game, right now.  I'm trying to use the AreCharactersColliding command, once the characters collide then you can play an attack animation on the zombie's part or a death animation for the player (but I haven't actually tested out the code yet).  If I'm not mistaken, it could work.
Title: Re:My zombie can't kill the player
Post by: Squinky on Fri 13/02/2004 23:00:52
Scummy
Yeah, thats what I figured, and I'm not sure either way how he's doing it. I wasn't trying to step on your toes or go against what you said though man...I'm sure you could out-script me in your sleep, heh...

Doctor Jekyll
I started using a more detailed version of this script I posted instead of the arecharacters/objectscolliding code because it only checked the baseline, not the entire character. This, of course didn't work, so I made up with this code:

if (character[MON].room==character[EGO].room)
if ((character[SHOT].x>character[MON].x-20)&&(character[SHOT].x<character[MON].x+20))
   if ((character[SHOT].y>character[MON].y-20)&&(character[SHOT].y<character[MON].y+20))

{
  character[SHOT].x = character[EGO].x;
 character [SHOT].y = character[EGO].y;
  character[SHOT].room=-1;
 
 
PlaySound(2);

 
 monhit--;
 
}


SHOT being the bullet, and MON being the badguy. If you need any help our beta-testing let me know.
Title: Re:My zombie can't kill the player
Post by: Scummbuddy on Sat 14/02/2004 04:49:27
looks good to me so far, and in no way was i trying to be snooty or put down your idea, nor did i take offense to your alternative take on the question posed. i guess my last post needed more smileyfaces.
Title: Re:My zombie can't kill the player
Post by: Gord10 on Sat 14/02/2004 10:36:00
Thanks again :) The player won't be able to move while a zombie is coming towards him.