プレイ日記
can someone help? theres a line break in 3...idk how 2 fix... ;_;
0そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
I have plenty of suggestions to make about your code. However, I'll stick to answering your question. There's no problem to be solved here. The message you are seeing that says "Break on Line --" is just telling you that the program was stopped while running the specified line. You stopped the program by pressing START/SELECT. This is required behavior for SmileBASIC.
0そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
In this case, it stopped on the line that says VSYNC. This is because of all instructions within your program's loop, the program spends more time on VSYNC. This comes naturally, as VSYNC limits how fast the program will run.
0そうだね
プレイ済み
返信[3]
親投稿
oh ok, now i see! Thanks!
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
To wrap it up, that break message you are seeing isn't an error. Don't worry about it. However, you should include a logical way to end the program. Forcing the user running it to forcibly stop it is not recommended. In this case, you could have a GOTO that goes outside the loop and finishes the program's runtime. You could also use the END instruction.
0そうだね
プレイ済み
返信[5]
親投稿
So...what are the suggestions you are thinking about for my code? I just want to make it as best as possible :]
0そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
Let's take it step by step... Line 1 contains an IF statement that will probably never execute, since it would require the user immediately pressing the button on program start. I'd suggest removing it. Lines 2 and 17 show that you are using a GOTO loop. This is heavily discouraged since it leads to unclear code. Stick to loop structures like WHILE...WEND.
0そうだね
プレイ済み
返信[7]
親投稿
idk if u knew but im new to smile basic xD and i dont fully understand some actions...
0そうだね
プレイ済み
返信[8]
親投稿
Oscar PwnageBlock
Lines 3 to 16 should be indented by a space since they are within a loop. Any code that's within another structure should be indented in relation to the structure to increase readability. Lines 1, 9, 10 and 16 should use constants instead of numbers directly in to improve readability. (E.g.: BUTTON() AND #A instead of BUTTON() AND 16) There are more, but I'll stop for now.
0そうだね
プレイ済み
返信[9]
親投稿
Oscar PwnageBlock
Do say if you need help.
0そうだね
プレイ済み