Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 1 invisible), 877 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
need a bit of help! #316874
03/27/10 13:49
03/27/10 13:49
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline OP
Senior Member
mikaldinho  Offline OP
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
how would you make a button start the game if it is pressed?

is it a function?

Re: need a bit of help! [Re: mikaldinho] #316877
03/27/10 14:09
03/27/10 14:09
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
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.

Last edited by DJBMASTER; 03/27/10 16:21.
Re: need a bit of help! [Re: DJBMASTER] #316896
03/27/10 15:54
03/27/10 15:54
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline OP
Senior Member
mikaldinho  Offline OP
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
thanks DJBMASTER! that will help me out with my project.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1