プレイ日記
duckymomo fluffyofqweam
i forgot again, how do i make it were you press a button it Does a action (a good example i would like is *button coding* goto @loop
1そうだね
プレイ済み
返信[1]
親投稿
Aaron pikamony
here's how i do it IF BUTTON(0)==16 THEN GOTO @LOOP 16 is for the A button. here is more buttons: 16 - A 32 - B 64 - X 128 - Y 1 - up 2 - down 4 - left 8 - right
1そうだね
プレイ済み
返信[2]
親投稿
Michael miccla00549
example:If button() and (#up) then goto @ loop
0そうだね
プレイ済み
返信[3]
親投稿
duckymomo fluffyofqweam
Arron doesn't work it automatically goes to the loop
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
Avoid using labels and GOTOs. Structured programming is the way to go! As far as buttons go, if you plan on working with various button inputs within a loop, you should assign BUTTON to a variable, like this... BTN=BUTTON(2) You can compare this variable using constants and logic gates. It follows a very simple, speech-like syntax!... IF BTN AND (#A OR #B) THEN 'DO SOMETHING
0そうだね
プレイ済み
返信[5]
親投稿
Oscar PwnageBlock
I also suggest looking through the BUTTON commands help entry. It contains an explanation to the parameters that BUTTON can take, as well as a list of all button constants you can use.
0そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
If you want to wait for the user to make any input, it can be as simple as... WHILE !(BUTTON()):WEND
0そうだね
プレイ済み
返信[7]
親投稿
Aaron pikamony
my way works too. i did it wrong first. if you want to stay simple anyway. a better example @example if button()==16 then goto @loop goto @example the 16 stands for A button. more buttons are like 32 is the B button. 64 is X. 128 is Y. and etc. petit professor on youtube might be more help if he has a video on it. another example. ?" ?" press A to end the game. ?" wait 10 goto @ex
0そうだね
プレイ済み
返信[8]
親投稿
Aaron pikamony
?" ?" press A to close the game ?" wait 10 goto @ex @ex if button()==16 then end goto @ex ↑↑↑↑↑ another example
0そうだね
プレイ済み
返信[9]
親投稿
LegoMaster ktbrenneis
@LOOP IF BUTTON(0)==16 THEN BEEP 17 GOTO @LOOP A program that beeps when you press A.
0そうだね
プレイ済み