need a bit of help!

Posted By: mikaldinho

need a bit of help! - 03/27/10 13:49

how would you make a button start the game if it is pressed?

is it a function?
Posted By: DJBMASTER

Re: need a bit of help! - 03/27/10 14:09

Yes you can define a function, and then pass it as the 'FunctionClick' parameter in your button defintion.

If you want to suspend the game from running until the button is pressed, you can use a simple variable and a while loop in the main function...
Code:
var start_game = 0;

function main()
{
while(start_game==0){wait(1);}
...
// start game bla bla
}


Then your function attached to the button will simply set this variable to 1.
Posted By: mikaldinho

Re: need a bit of help! - 03/27/10 15:54

thanks DJBMASTER! that will help me out with my project.
© 2024 lite-C Forums