Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Mr.Trant on Sat 10/05/2003 00:47:11

Title: Help with move character
Post by: Mr.Trant on Sat 10/05/2003 00:47:11
is there any way to make ur character move an extra 5 units or sumthin? like +15 or like that??
Title: Re:Help with move character
Post by: scotch on Sat 10/05/2003 00:55:07
What are you talking about? the character goes wherever you tell it to go..
Title: Re:Help with move character
Post by: Mr.Trant on Sat 10/05/2003 01:04:16
no, on key press, like have the letter "d" make the character run amination loop 8 and while that happens, move character like 15 units along the x axis!
Title: Re:Help with move character
Post by: Mr.Trant on Sat 10/05/2003 01:05:58
or make on key press letter "d", make the character switch animations and then move then switch back
Title: Re:Help with move character
Post by: scotch on Sat 10/05/2003 01:18:16
well when you want the character to move 15 along x then you put this line in your on key press function:

 if (keycode==68)  MoveCharacter(CHARID, (character[CHARID].x)+15, character[CHARID].y);
Title: Re:Help with move character
Post by: Mr.Trant on Sat 10/05/2003 17:06:26
yeah, but i want it to do a certain animation while it moves???
Title: Re:Help with move character
Post by: scotch on Sat 10/05/2003 17:10:43
Mr Trant, while I am going to tell you because I'm too helpful I suggest you work on a simple point and click game with no complicated idea that AGS doesn't really do by default if you can't even be bothered to work out/look up in the manual simple thins like this.

Anyway, just change the line to

if (keycode==68)  {MoveCharacter(CHARID, (character[CHARID].x)+15, character[CHARID].y); AnimateCharacter(CHARID,LOOP, SPEED, 0);}
Title: Re:Help with move character
Post by: Mr.Trant on Sat 10/05/2003 17:27:04
that didnt work, all it does is run the animation, not moving the char.

see, im trying to make the char jump to the right, i ve tried everything, but it either moves w/ the wrong animation or ir does the animation w/o moving!!! idk to do!!!