トピック
NayNay NayNay505

how do i asign a button to a task / label?

0そうだね
プレイ済み
返信[1]
親投稿
Josh josh.h7
If you mean you want it to go to a area in the code you can use GOTO or GOSUB like this IF BUTTON()==16 THEN GOTO @LABEL or IF BUTTON()==16 THEN GOSUB @LABEL with GOSUB you need return
1そうだね
プレイ済み
返信[2]
親投稿
NayNay NayNay505
ok, i understand, but whats the difference between GOTO and GOSUB?
0そうだね
プレイ済み
返信[3]
親投稿
Josh josh.h7
GOTO goes to the @label without a return GOSUB goes to the label and then returns back to the line that GOSUB is at
1そうだね
プレイ済み
返信[4]
親投稿
OlOOlOOl pi_r_round
GOTO is a one-way trip to some other location in your code. GOSUB is a temporary visit to some other place in your code. When the RETURN statement is encountered, it'll return to the statement after the GOSUB.
1そうだね
プレイ済み
返信[5]
親投稿
NayNay NayNay505
ok thx for the help now its time to go try it out! :{
0そうだね
プレイ済み
返信[6]
親投稿
mystman12 mystman12
Quick tip: When using BUTTON(), use "AND" instead of "==", so it looks like this: BUTTON(2) AND 16 This way, even if you are pressing other buttons, it will still see that A was pressed. Using "==" simply gives the value of all buttons being pressed added together.
2そうだね
プレイ済み