Monday, March 24, 2014

Day 15 - Jumping Behavior & Ray Casting


Today i've made the jumping behavior better. Taco (the dog) was not feeling responsive and his jump speed was not feeling fast enough. There was a bug on the control : sometime it misses a keyboard input, so pressing SPACE was doing nothing. i fixed that. I also increased the gravity to -20 (instead of -9.81) and adjusted the jumping force applied on Taco. I increased a bit the speed of obstacle. Taco jumping feels better now.

As soon as Taco collided with an obstacle, it was game over. This was ok most of the time... but not ok when Taco just landed a jump on a small wall... he should have been able to jump again instead of being hit... To make that happen, i changed a bit the way collision detection happen. I added a ray cast to detect collision in front of Taco (the red thin line in the video). Only an obstacle in front of Taco stop him. An obstacle below him is just like the ground, he can jump on it. This is true for the small wall, but maybe not true for the slowing bushes. Anyway, i'll check that another day. Today, Taco has a much better behavior =)

No comments:

Post a Comment