My zombie can't kill the player

Started by Gord10, Fri 13/02/2004 14:35:41

Previous topic - Next topic

Gord10

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   :)
Games are art!
My horror game, Self

Scummbuddy

#1
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
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Squinky

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

Gord10

Games are art!
My horror game, Self

Scummbuddy

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
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Nine Toes

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.
Watch, I just killed this topic...

Squinky

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.

Scummbuddy

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.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Gord10

Thanks again :) The player won't be able to move while a zombie is coming towards him.
Games are art!
My horror game, Self

SMF spam blocked by CleanTalk