Discussions

SmileBASIC Community

gavingamergavingamer

08/11/2016 12:49 PM ·Spoilers

Open Closed

how do you make a menu?

i'm trying to figure out how to make an interactive menu but i don't know how, could someone please help me with this?

Advertisement

Comment

This post has no comments.

  • Well, there isn't really a concrete concept or implementation of a menu. A menu can be anything that offers options to the user in order to do something. A simple implementation for a menu can be a limited number of options, where one of them is currently selected and you can change the selection through some method.

    Yeahs0
    Played
  • You could then finalize the selection by some method, and the program would continue depending on the selected option. For example, having 3 options "GAME A", "GAME B" and "EXIT", you could print them on screen. Your selection would be determined by a variable SLCT. You'd change this variable using BUTTON. You'd draw an arrow on screen depending on this variable to show what option is selected.

    Yeahs0
    Played
  • You could then finalize selection with BUTTON again. You would The example would look like this... REPEAT PRINT " GAME A" PRINT " GAME B" PRINT " EXIT" LOCATE 0,SLCT PRINT ">" B=BUTTON(2) IF B AND #DOWN THEN INC SLCT:IF SLCT>2 THEN SLCT=0 ELSEIF B AND #UP THEN DEC SLCT:IF SLCT<0 THEN SLCT=2 ENDIF WAIT 1:CLS UNTIL B AND #A

    Yeahs0
    Played
  • Sorry! Ignore the incomplete "You would" in my previous comment. I meant to say you should wrap the menu code in a loop, like I did. After a selection is made (by pressing A), you'll get out of the loop and SLCT will tell you what option was selected. This way you could have a branching conditional, like this... IF SLCT==0 THEN 'GAME A ELSEIF SLCT==1 THEN 'GAME B ELSE 'EXIT END ENDIF

    Yeahs0
    Played
  • THANKS!

    Yeahs0

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-EJ9-9E2C-3G9-2GKU

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: