Computer Science Canada How do you make a menu bar in a Turing game? |
Author: | zOriginaL [ Tue Jun 08, 2010 8:38 pm ] |
Post subject: | How do you make a menu bar in a Turing game? |
What is it you are trying to achieve? I am trying to add a menu bar to a game, just like the menu bar in a website. How would I code it so that, for example, if I am on the "Menu" page how would I get it to go the "Instructions" page back and forth? |
Author: | BigBear [ Tue Jun 08, 2010 8:41 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
make a procedure of the Instructions and any other pages you want and create a button or buttons of the pages and when they click that button run that procedure |
Author: | Cezna [ Wed Jun 09, 2010 7:11 pm ] | ||
Post subject: | RE:How do you make a menu bar in a Turing game? | ||
Look up GUI.CreateMenu in the Turing help section. Or just click on it in the syntax tag below
This allows you to use one of the new (well newest, since the Turing editor is no longer made by Holtsoft) widget modules in Turing. They are predefined procedures that are easy to use and can be quite versatile. |
Author: | USEC_OFFICER [ Wed Jun 09, 2010 7:23 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
I hear that the Turing GUI is a pain in the ass. Just so you know. |
Author: | Cezna [ Wed Jun 09, 2010 7:29 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
I have never used it, I usually just use my own buttons and interfaces, but then again, I haven't done much that would require this sort of stuff since learning about the GUI module, so I don't have any first hand experience with it. But for anyone short of an ingenious programmer or someone who is very dedicated and patient, it would take too much time and/or too much work to make a half-decent menu bar. Anyway, even if it does turn out to be a pain, at least you'll have the option, if you can't come up with anything else. |
Author: | USEC_OFFICER [ Wed Jun 09, 2010 7:32 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Half decent? I could make a decent bar in no time. (Pop down menus, buttons that react when you hit them.) All you need is a little bit of dedication, not a lot. Plus you can make it look better than the GUI buttons. |
Author: | Insectoid [ Wed Jun 09, 2010 7:36 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Turing's GUI buttons are ugly as a Texan in a speedo. All of my menus are just boxes and mousewhere(). |
Author: | Cezna [ Wed Jun 09, 2010 8:01 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Alright, maybe it wouldn't be that hard, but for someone who is new to the language, it might be easiest to use the GUI (ugly as I agree they are). However, in slight contradiction of my own point, I do believe that it is important that people eventually learn how to make these sorts of things themselves, but it is perhaps best not to start at the level of drop down menus if you have not even made a two state button yet. And until I figure out how to make a text input box from scratch that will allow more precise positioning than is possible using locate, I will have some use for the GUI module. |
Author: | InfectedWar [ Thu Jun 10, 2010 8:24 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Never use turing's GUI, object oriented programing is a big no no =d. You will never learn anything if you do OOP. Since the concepts are not universal to other languages, but with all of the other programming concepts from turing they carry on to different languages and they are actually useful. So word of advice try to stay away from OOP in turing =d (It's only for your own good) |
Author: | TerranceN [ Thu Jun 10, 2010 9:23 pm ] |
Post subject: | Re: RE:How do you make a menu bar in a Turing game? |
InfectedWar @ Thu Jun 10, 2010 8:24 pm wrote: Never use turing's GUI, object oriented programing is a big no no =d. You will never learn anything if you do OOP. Since the concepts are not universal to other languages, but with all of the other programming concepts from turing they carry on to different languages and they are actually useful. So word of advice try to stay away from OOP in turing =d (It's only for your own good)
Umm... What? I think you do not understand what OOP is. You do not even access the GUI module with objects, it is controlled internally, just giving you integers for reference (IIRC). What I think you mean is not to learn Turing's GUI module because it is only in Turing. Unfortunately all programming languages' standard libraries are different in some way, and thats not even getting to GUI/Graphics libraries (which are usually WAY different). The point of using these libraries is to be able to do common tasks easier, and using them makes you more able adapt to new libraries. So I disagree that you never learn anything, although reinventing the wheel can be a good learning experience. |
Author: | Cezna [ Fri Jun 11, 2010 5:19 am ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
OOP is object oriented programming, which is what Turing is based on. |
Author: | TerranceN [ Fri Jun 11, 2010 2:30 pm ] |
Post subject: | Re: RE:How do you make a menu bar in a Turing game? |
Cezna @ Fri Jun 11, 2010 5:19 am wrote: OOP is object oriented programming, which is what Turing is based on.
Based on? Please explain. To me OOP in Turing seems to be an afterthought, it is lacking features and everything that I know of in Turing's standard library does not use objects. Look at Java for instance, THAT is a language based on OOP. Everything is an object, it makes it easy and convenient to use objects, and its standard library (java.awt) has hundreds of classes that interact with each other. Maybe I'm just misunderstanding what you are saying. |
Author: | Cezna [ Fri Jun 11, 2010 2:57 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
http://compsci.ca/holtsoft/ Quoting from that link: "Turing 4.1.1 for Windows - The last version of the object oriented turing programming langue that was devloped for teaching students the basics of programming and was used in the ontraio school borad for some time." For a better explanation of object oriented programming then I could give you: http://en.wikipedia.org/wiki/Object-oriented_programming |
Author: | TerranceN [ Fri Jun 11, 2010 3:28 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
First of all, that is the same link (the wikipedia one) that I gave to InfectedWar. Second, saying a language is object oriented means that it supports some level of OOP, not that it is based on OOP (usually called "pure" OOP languages), or even does OOP well. Finally, this made me lol: "ontraio school borad" |
Author: | InfectedWar [ Fri Jun 11, 2010 3:37 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
TerranceN is right and when I mean stay away from certain things, I mean stay away from commands that do all the work for you like Math.Distance. The math will stay the same language to language, but this command will most likely not. (So for your own sake it's not good to use commands like that), but of course some commands there is just no option around them to do them without understanding how they mostly work. |
Author: | TheGuardian001 [ Fri Jun 11, 2010 3:59 pm ] |
Post subject: | Re: RE:How do you make a menu bar in a Turing game? |
InfectedWar @ Fri Jun 11, 2010 3:37 pm wrote: TerranceN is right and when I mean stay away from certain things, I mean stay away from commands that do all the work for you like Math.Distance. The math will stay the same language to language, but this command will most likely not. (So for your own sake it's not good to use commands like that), but of course some commands there is just no option around them to do them without understanding how they mostly work.
Ignoring the built in libraries of a language simply because other languages name their methods differently is quite possibly the most stupid thing I've ever heard. The libraries are there for a reason. Use them. |
Author: | InfectedWar [ Fri Jun 11, 2010 5:27 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
.. |
Author: | BigBear [ Fri Jun 11, 2010 7:16 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Using Turing built in GUI will cause random problems and therefore is not recommended |
Author: | Cezna [ Fri Jun 11, 2010 9:14 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
@ TerranceN I didn't say Turing was purely object oriented, or even effectively object oriented. When I said: "OOP is object oriented programming, which is what Turing is based on." that was poor wording on my part, what I meant to say was something along the lines of: "OOP is object oriented programming, which is what the GUI segment of Turing is based on." About the wikipedia link, I was posting it again as he still did not seem to know what OOP was, and hence I assumed he had not read the link you posted. I did not mean to take credit for the link. TheGuardian001 @ Fri Jun 11, 2010 3:59 pm wrote: InfectedWar @ Fri Jun 11, 2010 3:37 pm wrote: TerranceN is right and when I mean stay away from certain things, I mean stay away from commands that do all the work for you like Math.Distance. The math will stay the same language to language, but this command will most likely not. (So for your own sake it's not good to use commands like that), but of course some commands there is just no option around them to do them without understanding how they mostly work.
Ignoring the built in libraries of a language simply because other languages name their methods differently is quite possibly the most stupid thing I've ever heard. The libraries are there for a reason. Use them. Couldn't have said it better myself. ![]() |
Author: | InfectedWar [ Fri Jun 11, 2010 10:42 pm ] |
Post subject: | RE:How do you make a menu bar in a Turing game? |
Lol i've been saying what you said all along Cezna I already know what turing GUI is and how it uses OOP (Maybe the way I worded my sentences were not very well explained) All I said was you shouldn't use turing's GUI because it does too much of the work for you and you don't learn as much (honestly I like learning more and not having these special commands do most of the work for me). Nothing more, nothing less. I don't see how you made a big rant on it, just a simple opinion, you can have your own doesn't matter to me |
Author: | TerranceN [ Sat Jun 12, 2010 9:15 am ] |
Post subject: | Re: How do you make a menu bar in a Turing game? |
Cezna wrote: OOP is object oriented programming, which is what the GUI segment of Turing is based on.
Yes, internally the GUI module uses classes, but it hides you from them. If you wanted to extend (create a new class that inherits it, then using polymorphism change what something does) the button class, you would have to rewrite parts of the GUI module. If this was based on OOP then the AddButton would take a button object, so if you extend the Button object into a SuperButton class you can still pass that to the AddButton function (because it still is a Button). Thats why I keep saying it is not based on OOP. So if you could please explain how this is based on OOP, that would help a lot. |