After missing a week, DuckBall development continues! Starting a new job has cut into the amount of development time I have, but I managed to get in enough on the side to resolve the IsOnGround issue….mostly.
For the ducks to properly animate and land on top of platforms they need to know when they are on the ground, and this is information is stored in each duck’s IsOnGround boolean variable. When I was dealing with just the platforms and walls, getting IsOnGround to be true at the right times wasn’t too hard, but adding forty destructible brick tiles that collide with ducks and the ball made things more complicated.
In the last devlog update I mentioned that the IsOnGround variable was oscillating between true and false, as it turns out this wasn’t accurate. After working a little too long on the problem, I found that IsOnGround wasn’t oscillating between true and false, it was being set as true, and then false several times every frame. This made no damn sense at the time, so I used the debug text to figure out how many times each frame it was being set false. The answer: Forty, exactly the number of brick tiles in the level.
Eh….whooops…at some point I thought it was a good idea to bundle the collision logic of the brick tiles with rest of the level’s. After separating them I got what you see in the video: When a duck is resting on tiles or platforms it IsOnGround, and as a result its acceleration is corrected to zero and the standing animation is displayed.
It only mostly works though. If you look closely at the video, you’ll notice that when the duck is walking back and forth across multiple brick tiles, it sometimes flaps its wings momentarily. Also, taking off from the ground isn’t smooth, you have to double-tap the button to actually get off the ground. They’re behaving a lot better than they were three weeks ago though. Stupid ducks.
New Grump
DuckBall Devlog 007: Taking Off