Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mac on Thu 16/11/2006 15:39:17

Title: character.animate in different directions? [SOLVED]
Post by: Mac on Thu 16/11/2006 15:39:17
I currently have a jumping animation that plays when the up key is pressed, but I am unsure how I could make the direction of the jump animation corelate to the direction the character was already standing in. I'm thinking I would need to get the current loop number? I looked at "Loop property" in the manual which seemed to be what I wanted ("Gets/sets the character's current loop number) but there wasn't much information on how I would actually use that in this circumstance. Am I going the complete wrong way? Is there a much simpler way to do this?
Title: Re: character.animate in different directions?
Post by: Ashen on Thu 16/11/2006 15:51:42
This question (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28637.0) from not to long ago deals with pretty much this problem. (The title's not very clear, though, don't know how I missed that...) Just supply Character.Loop as the 'loop' parameter for the Character.Animate command, e.g.:

cEgo.Animate(cEgo.Loop, 3);


EDIT: That's why descriptive titles are important, for searches. I changed the title of the other thread after posting here, so it might not have turned up in your search.
Title: Re: character.animate in different directions?
Post by: Mac on Thu 16/11/2006 15:58:34
Sorry, I had done a search. Guess I searched for the wrong thing. But anyway, thanks very much, that works brilliantly.
Title: Re: character.animate in different directions? [SOLVED]
Post by: R4L on Thu 16/11/2006 20:20:20
You should look into Bernie's Gravity code. Its quite good.