Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PIT on Sun 07/01/2007 09:59:59

Title: Two player characters (at the same time)
Post by: PIT on Sun 07/01/2007 09:59:59
How can I make two characters walk at the same time.
I mean i have two characters walking with the keyboard, one of them uses W,S,A and D, the other uses the arrow keys.
But I can't make a non-blocking script.

Little help PLZ???

(I ask too many questions don't I)
Title: Re: Two player characters (at the same time)
Post by: Akatosh on Sun 07/01/2007 10:27:41
I guess your command looks like this:

if (keycode==372) cPlayer1.Walk(cPlayer.x, cPlayer.y-5); //Arrow up, player 1 walks up

but, in order to make a non blocking script, you need:

if (keycode==372) cPlayer1.Walk(cPlayer.x, cPlayer.y-5,eNoBlock);
Title: Re: Two player characters (at the same time)
Post by: PIT on Sun 07/01/2007 10:41:56
Thanx, I'll try it soon  :D
Title: Re: Two player characters (at the same time)
Post by: Ashen on Sun 07/01/2007 12:34:21
eNoBlock is the default for Character.Walk, so I don't think adding it would make any difference unless you'd already had eBlock there. (I which case, you should just need to remove it, not add eNoBlock.)

If Akatosh's suggestion doesn't work, can you show the code you're using to control the Characters? It's possible there's a confict, or something.