|
Menu?
Sept 13, 2013 19:45:51 GMT
Post by darken on Sept 13, 2013 19:45:51 GMT
Hi, I'v been trying to utilize menus in AGD 4.3, and it works. But I have question: I have a menu at start of game which consists of 2 items, START GAME and CREDITS How can I display different messages with different options chosen? I'v looked into readme, but there's just a brief description of MENU.
|
|
|
Menu?
Sept 13, 2013 20:34:26 GMT
Post by Jonathan Cauldwell on Sept 13, 2013 20:34:26 GMT
The selected option will be returned in the OPT variable. If the player chooses START, OPT will be 0; if he chooses CREDITS OPT will be 1.
You'll need something similar to this:
MENU IF OPT = 1 CLS MESSAGE 99 WAITKEY ENDIF
|
|
|
Menu?
Sept 13, 2013 23:44:39 GMT
Post by darken on Sept 13, 2013 23:44:39 GMT
Thanks, it works! Now I have another problem, shame on me for not thinking about earlier. I want to make a text adventure game. you have a description of place\situation and a menu with possible actions you can take. I it possible to make a labels and jump actions in event code? For example, when player enters CREDITS, program will wait with WAITKEY, but what happens when player press any key? How can I go back to the beggining of the code?(So main menu with GAME START and CREDITS will appear). Also...I don't quite understand HOW you save game as separate file. When I choose Save Game option and input name, borders flash for some time and all is done i can't find file I named in directory. I'm using Spectaculator as my emulator, if it helps in any way.
|
|
|
Menu?
Sept 14, 2013 11:32:52 GMT
Post by Jonathan Cauldwell on Sept 14, 2013 11:32:52 GMT
AGD isn't designed for backwards jumps, so this is a little complicated. You'll have to do it in a large REPEAT loop, with a variable, say P for play. The loop goes around 255 times but the menu is only displayed if PLAY was not selected (P=0).
LET P = 0 REPEAT 255 IF P = 0 CLS MENU 98 IF OPT = 1 CLS MESSAGE 99 WAITKEY ELSE LET P = 1 ENDIF ENDIF ENDREPEAT
Your save query will be down to an option in the emulator; alas, it's a while since I used Spectaculator and I'm unfamiliar with its menus. Perhaps someone else can help? While you're developing I'd suggest you save regular snapshots instead.
|
|
|
Menu?
Sept 14, 2013 23:18:47 GMT
Post by darken on Sept 14, 2013 23:18:47 GMT
Repeat seems to have a bad effect on game's font-it changes spacebar appearance . Here's my normal screen: And here's after adding repeat: BIGMessage have nothing to do with it. My code is as follows: let lives 3 colour 71 border 0 let p 0 cls repeat 255 if p 0 cls let line 0 let column 0 colour 7 bigmessage 1 beep 100 menu 2 if opt 1 cls let line 0 let column 0 message 3 waitkey else let p 1 endif endif endrepeat
|
|
|
Menu?
Sept 17, 2013 20:30:02 GMT
Post by Jonathan Cauldwell on Sept 17, 2013 20:30:02 GMT
It looks as though some of the event code is overwriting the font, another issue to investigate. I can't think why that might be happening.
|
|
|
Menu?
Sept 17, 2013 20:35:54 GMT
Post by darken on Sept 17, 2013 20:35:54 GMT
Oh well, I try to make different game, then. Thanks for help, anyway
|
|
|
Menu?
Apr 25, 2014 13:11:54 GMT
Post by kas29 on Apr 25, 2014 13:11:54 GMT
Guys, what a variable OPT? Something in the instructions not found..
|
|
|
Menu?
Apr 27, 2014 18:29:36 GMT
Post by Jonathan Cauldwell on Apr 27, 2014 18:29:36 GMT
OPT is a variable. It holds the last option selected when you use the MENU command, although you could use it for something else if you wanted.
|
|
|
Menu?
Apr 28, 2014 1:45:02 GMT
Post by kas29 on Apr 28, 2014 1:45:02 GMT
Thanks, now I know...
|
|