3 ms·
If you play the game, it's actually quite trivial to program deterministically. :-) Flapping is not implemented as an impulse. It's more like jumping in Mario -
by kenferry 13y ago
If you play the game, it's actually quite trivial to program deterministically. :-) Flapping is not implemented as an impulse. It's more like jumping in Mario - it instantaneously fires a canned "flap" movement that is always the same.
Set flap_height = bottom of next pipe + constant.
If bird height < flap_height, flap.
Done!
- userbinator 13y agoIt also looks like you'd want to avoid flapping into the top of the pipe.
- kenferry 13y agoPerhaps I should have said "threshold_height". threshold_height = bottom_of_pipe_height + 10 pixels; // or something if (current_height < threshold_height) flap else don't flap If you never flap when above the threshold, you will not hit the top.