トピック
gavingamer gavingamer

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?
4そうだね
未プレイ
返信[1]
親投稿
Oscar PwnageBlock
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.
0そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
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.
0そうだね
プレイ済み
返信[3]
親投稿
Oscar PwnageBlock
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
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
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
0そうだね
プレイ済み
返信[5]
親投稿
gavingamer gavingamer
THANKS!
0そうだね
未プレイ