After entering in the code you provided, the blue car (sprite definition number: 1) is now offset. Also, I mistakenly said A button, I meant Left Arrow. I changed the code to use that instead.
There! I set the X and Y variables for the car, as well as X and Y variables for the other three cars. Now I just need button commands for the other three. But before, I've realized that two buttons being pressed at the same time causes it to not react at all. Can I have help with that?
The method is so simple. Replace line 61 with follows.
X1=X1+((K AND #LEFT)!=0)*2
X2=X2+((K AND #B)!=0)*2
X3=X3+((K AND #L)!=0)*2
X4=X4+((K AND #R)!=0)*2
If you replace "*2" by greater value, the car will move faster.
And thanks. While waiting for your response, I had already figured out the speed change thing. The Race mini game works good now, I just need to add the SPHITSP commands so it knows who won. And the ACLS command to clear text. Thank you!
AND is the most often-used operator to detect multiple button pressing.
If you press L without pressing R,
((K AND #L)!=0)==TRUE, ((K AND #R)!=0)==FALSE
If you press R without pressing L,
((K AND #L)!=0)==FALSE, ((K AND #R)!=0)==TRUE
If you press both L and R at the same time,
((K AND #L)!=0)==TRUE, ((K AND #R)!=0)==TRUE
I'm now having trouble with the finish line. Only will Player 1 actually activate it. The Finish line is actually a 16x16 sprite, re-scaled. Maybe that messed up the collision box?
SPCOL N,TRUE should be followed by SPSCALE.
The second argument of SPCOL allows collision detection area to follow sprite size, but if SPCOL N,TRUE is done after SPSCALE, size of collision detection area will be kept the state before SPSCALE is done.
Oh... Well, I already worked around it by creating three large sprites and lining them up, making sure none of the cars miss the collision boxes. Thanks, though.