? How do you use the buttons (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
This website has been moved, please see this post

How do you use the buttons

1 2
  • #1 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies I looked at the in-game manual for help but the explanation it gave me was not detailed enough. Plz Help Posted
  • #2 ✎ 17 Toodles78 First Day Joined on the very first day of SmileBASIC Source Website Star Wars Is Awesome! I love Star Wars! Express Yourself Avatar Taboo I didn't change my avatar for 180 days Website What do you want to use the buttons for? As input in a program? Posted
  • #3 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Make a variable or just use BUTTON(). As in: IF BUTTON()=={blah blah} THEN {blah} The first blah is what you want the button to be. It's quite hard to remember them all: 1- up 2- down 4- left 8- right 16- a button 32- b button 64- x button 128- y button 256- l trigger 512- r trigger For example, if I want the program to wait until the A button is pressed, then I would put something like: @LOOP IF BUTTON()==16 THEN GOTO @BLAH GOTO @LOOP If you need any more scenarios or examples you can always ask. People here are glad to help! Posted Edited by joelable
  • #4 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies This worked thanks Posted
  • #5 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies No problem! Glad to help! Posted
  • #6 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies Wait so what if i wanted a certain beep to come from pressing the button Posted
  • #7 ✎ 6 doctorderp11
    Wait so what if i wanted a certain beep to come from pressing the button
    You would put a beep command in @BLAH @LOOP IF BUTTON()==16 THEN GOTO @BLAH 'this part GOTO @LOOP
    Posted
  • #8 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies You could use BEEP as a result of a button press. Like: IF BUTTON()==16 THEN BEEP GOTO @LOL ENDIF Posted
  • #9 ✎ 27 TriforceOfKirby You don't need to remember the button codes in SmileBASIC, there are pre-defined constants for that: IF BUTTON() AND #A THEN BEEP I would recommend using AND instead of == because it allows for pressing other buttons with it. So for example, if you are holding L and press A, it wouldn't detect A being pressed if you used ==, but it would if you used AND. Posted
  • #10 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies It detects two buttons for me if I do something like IF BUTTON()==65 THEN BLAH I put sixty five since its 64 (x button) and 1 (up on dpad) and it works. Posted
  • #11 ✎ 27 TriforceOfKirby I'm not sure if you understood me; in my example, you wouldn't care about the other button (L). All you want to know is if the user pressed A, but pressing another button while pressing A will prevent the following from working: IF BUTTON() == #A THEN BEEP With this you can ONLY be pressing A and nothing else or else it won't BEEP; Holding L while pressing A won't trigger this. By doing this: IF BUTTON() AND #A THEN BEEP You can be pressing all the buttons you want and it would ignore them, only caring about if you pressed A; you could be holding UP, DOWN, L, R, etc. and press A and it will still BEEP. Posted Edited by TriforceOfKirby
  • #12 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Oh okay. That's actually going to be very helpful Posted
  • #13 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies Thanks for all the help guys! Posted
  • #14 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies So how do i have more than one button work,when try to the others dont work but the first one in the program does Posted
  • #15 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Maybe something like: IF BUTTON() AND #A+#B THEN blah blah If it doesn't work for whatever you're asking, sorry. I didn't really get what you posted and I dont have my 3DS so I can't test what I'm posting. Posted Edited by joelable
  • #16 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Ummm to have two or more buttons do the same thing then maybe like: IF (BUTTON() AND #A) OR (BUTTON() AND #B) THEN BEEP And just add more "OR (BUTTON() AND blah)" for more buttons. If you want every button to do the same thing the use: IF BUTTON()>0 THEN BEEP Posted Edited by joelable
  • #17 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies sorry, i meant that if i type: @LOOP1 IF BUTTON()==16 THEN GOTO @BLAH GOTO @LOOP1 Then I type @LOOP2 IF BUTTON()==32 THEN GOTO @BLAH2 GOTO @LOOP2 Only @LOOP1 wants works, @LOOP2 seems to just be ignored Posted
  • #18 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies Then put them on the same loop, like @LOOP IF BUTTON()==16 THEN GOTO @BLAH IF BUTTON()==32 THEN GOTO @BLAH2 GOTO @LOOP Posted Edited by joelable
  • #19 ✎ 416 ElzoBro First Day Joined on the very first day of SmileBASIC Source Website Video Games I like to play video games! Hobbies Drawing I like to draw! Hobbies Oh, Ok thanks! i think i can try to make Simon Says esque game now Posted
  • #20 ✎ 308 joelable First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Video Games I like to play video games! Hobbies I might make a Simon Says game myself. It'll be a fun project! Posted
1 2