Friday, October 23, 2009

Case 05 - Final

Hey ho.

Been a while now. Hasn't really happened that much since I posted last time. I fixed the landscape and background but other than that I didn't see the point of changing too much stuff.

I'm going to eplain briefly how I went about with this case.

  • First I added two variables, one for gravity and one for velocity. These two wil decide the height and speed of jumps.
  • Then I added a function that, while also checking if the player hits the ground, enables you to jump. This is done by adding the gravity and velocity from the variables. Then I also specify an hit test that checks the players collision point hits the ground. In the line I've added true, this means that it tests the actual pixels and not the boundingbox of the ground movieclip. This enables me to have varied landscapes in stead of just a flat one.
  • Still in the same function I add a conditional that cancels out any attempts to jump while in air and already in a jump.
  • Lastly I add a function for the velocity of the jump.
You've already seen the result in the previous post, but I'll add the updated one :)



Case 05 - Revised by ~Elr0hiR on deviantART

No comments:

Post a Comment