? How to make a title screen that works (text only) (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
What's going on?? See: Site Update March 2022

How to make a title screen that works (text only)

  • #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 when do something like @TITLE PRINT"Title Screen" B=BUTTON(2) IF B AND A GOTO @MENU1 @MENU1 BEEP PRINT"HI" For some reason it prints the title but then the program just ends any help? *~* Posted
  • #2 ✎ 11 MyLegGuy
    when do something like @TITLE PRINT"Title Screen" B=BUTTON(2) IF B AND A GOTO @MENU1 @MENU1 BEEP PRINT"HI" For some reason it prints the title but then the program just ends any help? *~*
    Yeah, because the program reaches the end. @TITLE PRINT"Title Screen" B=BUTTON(2) IF B AND A GOTO @MENU1 GOTO @TITLE @MENU1 BEEP PRINT"HI" GOTO @MENU1 You may want to put CLS and VSYNC or WAIT.
    Posted
  • #3 ✎ 246 Avery First Week Joined in the very first week of SmileBASIC Source Website Third Year My account is over 3 years old Website Disguised Hidden Website
    @TITLE PRINT"Title Screen" B=BUTTON(2) IF B AND A GOTO @MENU1 @MENU1 BEEP PRINT"HI"
    Your problem is the program keeps running past the IF statement onto the rest of the program. I think you're expecting the IF statement to hold the program from continuing. Instead of your IF statement, replace it with this. REPEAT:UNTIL B AND A This will hold the program until "B AND A" evaluates to TRUE. EDIT: I made a mistake! REPEAT:B=BUTTON(2):UNTIL B AND A This is the line you need! The other one freezes the program because the variable B never updates. Actually, I think the best way to do it is this: @TITLE PRINT"Title Screen" REPEAT:UNTIL BUTTON(2) AND A BEEP PRINT"HI" You can get rid of the B= and @MENU1 lines because they're unnecessary to my eyes.
    Posted Edited by Avery