プレイ日記
Luigi64 LuigisFriend
Can someone help me with this code? I need a way to make the character onscreen not flicker as much.
2そうだね
プレイ済み
返信[1]
親投稿
Caleb caleb.devontx
VSYNC [Wait period] or WAIT [Wait period] they both do they same thing and will help your object not to flicker that much
0そうだね
プレイ済み
返信[2]
親投稿
Luigi64 LuigisFriend
ok i'll try it.
0そうだね
プレイ済み
返信[3]
親投稿
V360 TheV360
For example: WHILE 1 'Start infinite loop IF BUTTON() AND #LEFT THEN:X=X-1 IF BUTTON() AND #RIGHT THEN:X=X+1 IF BUTTON() AND #UP THEN:Y=Y-1 IF BUTTON() AND #DOWN THEN:Y=Y+1 LOCATE X,Y:?"@"; 'Moves text cursor to X,Y and prints @ without adding a line break VSYNC 'Wait a frame WEND 'End infinite loop
1そうだね
プレイ済み
返信[4]
親投稿
Luigi64 LuigisFriend
V360 I tried that, and it worked, but the method of repeatedly using ACLS wasn't working. I need a method to only clear the screen when the dpad is pressed. Any help would be greatly appreciated.
0そうだね
プレイ済み
返信[5]
親投稿
V360 TheV360
Try using CLS instead of ACLS.
0そうだね
プレイ済み
返信[6]
親投稿
Caleb caleb.devontx
Try this, first make button a variable: b=button(). Then make the following if statement: if b>1 then cls 'or acls
0そうだね
プレイ済み
返信[7]
親投稿
Luigi64 LuigisFriend
Thanks V360! It worked! Also thanks for the idea Caleb, i'll probably use that in another project,
0そうだね
プレイ済み
返信[8]
親投稿
Stewart segludian
As mentioned above, ACLS clears EVERYTHING and is probably not what you want. CLS clears just the text and will be better. Still, I think we can do better still with the dirty rectangles technique. With that you only update what changed on screen. I rewrote your code (see attached) to use it and it seems plenty fast. Give it a try let me know if you find bugs.
1そうだね
プレイ済み
返信[9]
親投稿
Luigi64 LuigisFriend
Tried your code and it worked!
0そうだね
プレイ済み