#1✎ 4TovicalSorry, terrible noob question, but how do I make button presses register only once? I found BREPEAT, but I must be badly misunderstanding how it works.
IF BUTTON(3) AND #A THEN PRINT "A"
Then, when I run it and press A the screen fills with A all the way down the screen.
Edit: Okay, I just realized how I'm using BREPEAT is just turning the feature off. Still, my questions about how to make a button press only register once remains, because I don't feel like setting time constraints on a button press is the right way to do it...
#2✎ 167PixelStudioI think i understand what you mean...try this
if b and 16 then print "A"
Also if this isn't what your looking for then just make another loop thats the same but change the variable of button. So instead of b make it something else like c
#3✎ 4TovicalThank you! That did what I needed; now I just need to compare the two sets of code to see why yours worked and mine didn't, so I can understand the language better xD
#4✎ 308joelableFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfVideo GamesI like to play video games!HobbiesThe button() function functions differently for every number inside of the parens. For 0, it's just if it's pressed. For 2, it's just the instant it's pressed, so it's only inputted once, until you let go of a button. The others are different though, but these are usually used the most.
#5✎ 4TovicalSome testing solved it - my code would have worked, too, if I had used VSYNC.
Perhaps someone can help me understand what it is that VSYNC does that turns the output from
to just a single A?
#6✎ 308joelableFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfVideo GamesI like to play video games!HobbiesVSYNC pauses the program for a set amount of frames. If a number after VSYNC is omitted it will just wait 1 frame, what most programs usually wait in a loop. Omitting a VSYNC in a loop like yours would turn the one button input into a lot, because the program is running extremely fast. Putting the VSYNC allows the program to pause an unnoticeable amount, yet let things like button inputs only happen once.
Thank you! That did what I needed; now I just need to compare the two sets of code to see why yours worked and mine didn't, so I can understand the language better xD
#8✎ 41DasEtwasif you have a long code inside of your main loop, button(2) may miss sometimes, so here is the oldschool variant:
IF B!=BLAST THEN BT=B
The thing you want then is BT.