torsdag den 22. oktober 2009

Case 5 - Jumping and Gravity

This time around we needed to Make the character jump by pressing the "up" key and that implies something we call gravity. It was as little hard to get to work. I kinda understood the principle and structure i needed in my code but for some reason, Flash's logic is different than mine :)

I got alot of help and insight on this case, though i understand why my code works now, but i can still encounter problems and errors which i just can't understand. But a little try and error have never hurt nobody :P

The gravity does not only deaccelerate the character on the way up and accelerate on the way down. but also constant checks wether he is touching the ground, which allows him to not fall through it. This way he follows the ground surface even if the ground is curvy.

Ingen kommentarer:

Send en kommentar