im having a problem on the game im currently working on. im trying to make it so that when i press A it shows more text progressively. but it just ends up showing all the text.
#NEEDHELP
Now what if you tried doing something like this?
PRINT "Message 1"
WAITFOR #A
PRINT "Message 2"
WAITFOR #A
'BTN can be any button combination
DEF WAITFOR BTN
'while user is not pressing BTN:
WHILE BUTTON() AND BTN==0 VSYNC WEND
'while user is pressing BTN:
WHILE BUTTON() AND BTN!=0 VSYNC WEND
'user has now pressed and released BTN
END
Actually, you could probably make your code work with one simple fix. You have no wait after the button input is detected, so it's going through all of them with one button press. Just put, WAIT 5 after each -
IF BTN THEN
DOSTUFF
WAIT 5
ENDIF
You need another while loop
You need two while loops between each message, not just one:
WHILE BUTTON() AND #A==0:VSYNC:WEND WHILE BUTTON() AND #A!=0:VSYNC:WEND
Try to understand what's going on
When you run it, a cursor reads each instruction left to right, top to bottom
The cursor is stuck in the while loops
Try typing in the code from one of the first two comments by Hanzo or me, you need those two WHILE statements in between every single print command, you are only doing both WHILE loops once, that's why it's not working like you are expecting.
i still cant figure it out. i just dont understand. here's the key i would love it if one of you guys could take a look at the problem.
its in line 1764
Could you download DS4R393 and refer to EX_KEYFLUSH?
Button status will be kept for at least 1/60sec after you release buttons. Therefore you should FLUSH button buffer every time you detect buttons.