I've been working on my attempt at a "re-programming" of Rally-X in BASIC for a while. But I've never quite been able to feel satisfied with it until today. Darren Atkinson's machine language subroutine for refreshing the screen from a large sequence of array strings was a big help. Before it, I had been using a bunch of PRINT MID$ of the array strings, and it was just too slow to refresh the screen background in an adequate fashion.
Now it is just a barely noticeable page flipping background effect. But the speed of game play was actually up to a point of being a little too fast for fair navigation with such a small window. The enemy car can swoop in and really get you. Part of the reason for that is that the key sensing routine that I was using consisted of the single check for all 4 directions:
But as I have learned from Greg Dionne, these key sensing PEEKs have their limitations, and will occasional "latch" when certain double key combinations are input. When that happens, the only way to "unlatch" and be able to input a desired direction is to release all keys, hit another key other than the one you were trying to input, and then select the arrow key you wanted. It's a fairly intermittent and rare effect, so in many game application its not a problem. The advantage of needing to do only 2 PEEKs to get a direction outweigh the occasional quirky response. But in this game good reliable responses are really needed. The enemy can really get close, and every keystroke counts. So I switched to the keyboard rollover peeks suggested by Greg Dionne. That table provides absolutely reliable return values for the four direction keys. But it uses individual IF statements to determine which keys are pressed:
10 IF PEEK(2) AND 4 AND NOT PEEK(16952) THEN PRINT@1,"W";
20 IF PEEK(2) AND 1 AND NOT PEEK(16946) THEN PRINT@2,"A";
30 IF PEEK(2) AND 4 AND NOT PEEK(16948) THEN PRINT@3,"S";
40 IF PEEK(2) AND 1 AND NOT PEEK(16949) THEN PRINT@4,"D";
50 GOTO 5