truly: this is just too funny :P
You replaced all your () with [] in your source. I mentioned before that I was talking forum-codes, not Blitz-code.
So, I meant that you put your sourcecode between forumcode tags, namely: (code) and (/code) or (codebox) and (/codebox). The reason I say 'replace () with []' is because I can't type (code) or (codebox) because it then makes a codebox .. and the command disappears from a post then.
So, leave your blitzsourcecode as it is, but put it between tags! It reads a lot better for the people who try to help you.
About your code: it's not the right way to do this thing. You never make functions like those to check for specific menu items (well, obviously you could, but you want to learn proper code, do you?)
In your example you're linking the technical concept of 'a menu' with the actual visual implementation, which is not something you should do. What you should try to do is:
- make code that displays *any* menu, of any size with any amount of menu choices, anywhere on the screen
- define your menu content (newgame, options, quit etc.) somewhere else, but *not in the menu code!*
So, how to start?
Divide your menu into two parts:
- a technical list, which is purely a list of menu options. Note that you should know the length of this list. How you'll be implementing that is up to you. I'd put it in a bank orso, but you could also make some global array$ and a global value for the length of this array.. it's just that I don't like globals .. :P You could also store the amount of menu items in the first array item.. then you only need one array! Anyway, that's up to you again.
- make a visual displayer for this technical list. This displayer should of course be able to display any list you made, as long as the list technically works the same.
This displayer should have properties like: x, y, width, height, itemheight, maxitems, currentoption .. and another bunch o' stuff.
Probably a lot of stuff for -I estimate :P- a beginner, but you gotta start somewhere, eh..
Best tip I can give tho is to start slowly, a game is about the most tricky thing one can make. Start easy/slowly with small dull things, learn bit by bit, try to learn to think ahead, try to envision what will happen when you code into a certain direction instead of another direction.
You replaced all your () with [] in your source. I mentioned before that I was talking forum-codes, not Blitz-code.
So, I meant that you put your sourcecode between forumcode tags, namely: (code) and (/code) or (codebox) and (/codebox). The reason I say 'replace () with []' is because I can't type (code) or (codebox) because it then makes a codebox .. and the command disappears from a post then.
So, leave your blitzsourcecode as it is, but put it between tags! It reads a lot better for the people who try to help you.
About your code: it's not the right way to do this thing. You never make functions like those to check for specific menu items (well, obviously you could, but you want to learn proper code, do you?)
In your example you're linking the technical concept of 'a menu' with the actual visual implementation, which is not something you should do. What you should try to do is:
- make code that displays *any* menu, of any size with any amount of menu choices, anywhere on the screen
- define your menu content (newgame, options, quit etc.) somewhere else, but *not in the menu code!*
So, how to start?
Divide your menu into two parts:
- a technical list, which is purely a list of menu options. Note that you should know the length of this list. How you'll be implementing that is up to you. I'd put it in a bank orso, but you could also make some global array$ and a global value for the length of this array.. it's just that I don't like globals .. :P You could also store the amount of menu items in the first array item.. then you only need one array! Anyway, that's up to you again.
- make a visual displayer for this technical list. This displayer should of course be able to display any list you made, as long as the list technically works the same.
This displayer should have properties like: x, y, width, height, itemheight, maxitems, currentoption .. and another bunch o' stuff.
Probably a lot of stuff for -I estimate :P- a beginner, but you gotta start somewhere, eh..
Best tip I can give tho is to start slowly, a game is about the most tricky thing one can make. Start easy/slowly with small dull things, learn bit by bit, try to learn to think ahead, try to envision what will happen when you code into a certain direction instead of another direction.