← A8D8 Bat-bounce angles (expanded bat) Map A954 → Hold a ball on the bat, and release it
A938: Speed the ball up as the rally continues
Counts a ball's bounces and raises its speed a step at each rally interval, so a long rally ends fast.
Input
IY the ball state record
ball_accelerate A938 INC (IY+$0A) Bump this ball's bounce count and stash the new value.
A93B LD A,(IY+$0A)
A93E EX AF,AF'
A93F LD A,(rally_accel_interval) The rally interval is the number of bounces between speed steps.
A942 LD B,A
A943 EX AF,AF'
A944 CP B Counter short of the interval? Leave the speed unchanged.
A945 RET NZ
A946 XOR A Interval reached: restart the bounce count for the next step.
A947 LD (IY+$0A),A
A94A LD A,(IY+$06) Ball speed is capped; stop if it is already at the cap.
A94D CP $06
A94F RET Z
A950 INC (IY+$06) Raise the ball's speed by one step.
A953 RET
← A8D8 Bat-bounce angles (expanded bat) Map A954 → Hold a ball on the bat, and release it
Fork me on GitHub