Am currently trying to work through some logic to do TANK-PONG like logic to a ball, for my Dodgeball game.
P0Velocity is arranged as thus: RLDU 0000 where the lower nibble is a delay in frames.
The rest should be pretty straightforward, (and the S variables are being persisted outside this routine), am trying to do something like this description;
; Immediately after a collision, it tries a vertical reflection, ; jiggering the result so that it won't be exactly vertical or ; exactly horizontal. ; ; If this is the next frame (MxPFcount=$01) that failed, so ; we reverse direction 180 degrees to turn it into a horizontal ; reflection. ; ; On MxPfcount=$02 we take no action, since the missile may need ; the cycle to re-emerge from a wall. ; ; On MxPFcount=$03 or higher, we retrieve the original heading and ; turn it 180 degrees, assuming a corner reflection. And we keep ; applying this same bearing until it's out of the #*%@ wall.