Computer Science Canada

I dont understand how to make buttons that change procedures

Author:  iliaz [ Wed Jan 02, 2008 2:55 pm ]
Post subject:  I dont understand how to make buttons that change procedures

Hello! I am currently working on an Independant Study Project for school, and i am stuck on making buttons. Basically i am suposed to make a driving game with a main menu. the menu should have two buttons: quit, and play game. i cannot seem to get how to create and use the buttons. i use procedures, and when you select the QUIT button, it is supposed to go to the "goodbye" procedure, which says stuff like "thanks for playing". when you press play game button, it should go to the procedure in which the game is. Is this even possible to do? Is this happening because i am using procedures? HELP will be greatly appreciated =).

Author:  Zampano [ Wed Jan 02, 2008 3:07 pm ]
Post subject:  Re: I dont understand how to make buttons that change procedures

GUI.CreateButton (x,y,width,text,procedure)
Unless I am mistaken, that will help you.
Then, you just need a
code:
loop
exit when GUI.ProcessEvent
end loop

after the buttons so that input keeps getting read.

Author:  iliaz [ Wed Jan 02, 2008 6:38 pm ]
Post subject:  Re: I dont understand how to make buttons that change procedures

Thanks, but i dont understand where to put it all. Could you add in the buttons, and reupload it please? thanks.

Author:  Kharybdis [ Wed Jan 02, 2008 8:16 pm ]
Post subject:  Re: I dont understand how to make buttons that change procedures

Heh. nice game.

Buttons are really easy to make. Depending on what version of turing you have, there should be a "help" menu with an index attached. If you're in trouble with a certain command, use the index for more clarification. All programming languages have it.


: