Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Xyphox on Mon 27/07/2009 23:26:27

Title: What's a good way to make a character swim
Post by: Xyphox on Mon 27/07/2009 23:26:27
What's a good way to make a character swim rather than walk when he enters the water?
Title: Re: What's a good way to make a character swim
Post by: on Mon 27/07/2009 23:31:12
Create a "swimming animation", and replace the character's normal view with it as soon as he enters the water. You can use a region to check if the character is in the water, and another one to check if he's leaving the pool/ocean/whatever.
Title: Re: What's a good way to make a character swim
Post by: monkey0506 on Mon 27/07/2009 23:32:06
Use a different view. Just animate the part of his body that would be above the water (unless of course you want to see the part that's underwater as well) and put some ripples in the character sprites. Make the water a separate walkable area and change his view while he's on that area. You could possibly even create an animation to show him "diving" into the water or some such. Not that hard.

Edit: Beated out by Ghost, but I don't care. Coz I'm a rebel.
Title: Re: What's a good way to make a character swim
Post by: Xyphox on Tue 28/07/2009 00:00:52
Got it! Thanks so much
Title: Re: What's a good way to make a character swim
Post by: Vukul on Tue 28/07/2009 07:33:52
And remember, that swimming people, while they're not moving in the water, do not "stand" motionless either.
That means, the character should be constantly in motion, thus you should also create an additional Idle view for the character,
then using the SetIdleView function in the script assign this view and set Delay to 0.
That will make him stay afloat immediately after he stops moving.