Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kafka on Thu 12/01/2006 13:35:13

Title: Character fall
Post by: kafka on Thu 12/01/2006 13:35:13
How can I make my character fall from the top of the room?
Title: Re: Character fall
Post by: Khris on Thu 12/01/2006 14:25:30
If you intend to do this in a cutscene, use something like this:

int c=0;
while (c<230) {
Ã,  cRoger.z=c;Ã,  Ã,  Ã,  // Characters z-coord represents height
Ã,  Wait(1);Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // without this line, movement would happen in an instant
Ã,  c++;
}
Title: Re: Character fall
Post by: kafka on Thu 12/01/2006 14:56:00
Thanks :)
Title: Re: Character fall
Post by: Khris on Thu 12/01/2006 15:41:07
I've just noticed that my code makes the character rise...
change it to
int c=cRoger.y;
while (c>0) {
Ã,  cRoger.z=c;
Ã,  Wait(1);
Ã,  c--;
}
Title: Re: Character fall
Post by: kafka on Thu 12/01/2006 15:49:44
Heh. I noticed that and I changed the code that it falls. :)